Skip to content

Commit

Permalink
try pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
peni4142 committed Dec 9, 2023
1 parent 84ff012 commit f208d01
Showing 1 changed file with 17 additions and 41 deletions.
58 changes: 17 additions & 41 deletions .github/workflows/standard-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,28 @@ on:
- 'develop'
- 'feature/**'
- 'bugfix/**'
pull_request:
branches:
- 'main'
- 'master'
workflow_dispatch: {}

env:
DTC_VERSION: v3.1.2

jobs:
docker:
build:
runs-on: ubuntu-latest
steps:

test:
runs-on: ubuntu-latest
needs: [build]
steps:


deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: [build, test]
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build Image
uses: docker/build-push-action@v3
with:
context: alpine
build-args: DTC_VERSION=${{ env.DTC_VERSION }}
load: true
# TODO Make tag/version dependent on branch (push normal version only when on main branch, otherwise derive temporary version from branch name/datetime/commit-id/...)
tags: doctoolchain/doctoolchain:${{ env.DTC_VERSION }}
-
name: Test Image
run: |
docker run \
--rm \
-v ${PWD}/test:/workspace \
-w /workspace \
doctoolchain/doctoolchain:${{ env.DTC_VERSION }} \
bash -c "set -eu; test -w /etc/environment && ls -l /etc/environment; doctoolchain . tasks"
-
name: Push Image
uses: docker/build-push-action@v3
with:
context: alpine
push: true
tags: doctoolchain/doctoolchain:${{ env.DTC_VERSION }}

0 comments on commit f208d01

Please sign in to comment.