From 8b9ccbd5433dd8499d9d3fbbf006ddfec84094ca Mon Sep 17 00:00:00 2001 From: JanWichelmann Date: Wed, 7 Oct 2020 20:58:12 +0200 Subject: [PATCH] Upgrade docker build action --- .github/workflows/publish-docker.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index ece17a4..421559d 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -10,6 +10,7 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout code - uses: actions/checkout@v2 # From https://github.community/t/how-to-get-just-the-tag-name/16241/7 @@ -19,21 +20,26 @@ jobs: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/server\//} echo ::set-output name=SHORT_HASH::$(git rev-parse --short "$GITHUB_SHA") + - name: Set up builder + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_ACCESS_TOKEN }} + - name: Build and push main server docker image - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v2 with: - repository: ctf4e/ctf4e-server - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_ACCESS_TOKEN}} + push: true tags: latest,${{ steps.get_version.outputs.VERSION }} - dockerfile: src/Ctf4e.Server/Dockerfile + file: src/Ctf4e.Server/Dockerfile build-args: BUILD_VERSION=${{ steps.get_version.outputs.SHORT_HASH }} - name: Build and push lab server docker image - uses: docker/build-push-action@v1 + uses: docker/build-push-action@v2 with: - repository: ctf4e/ctf4e-labserver - username: ${{secrets.DOCKER_USERNAME}} - password: ${{secrets.DOCKER_ACCESS_TOKEN}} + push: true tags: latest,${{ steps.get_version.outputs.VERSION }} - dockerfile: src/Ctf4e.LabServer/Dockerfile \ No newline at end of file + file: src/Ctf4e.LabServer/Dockerfile \ No newline at end of file