From d39c36cc037b963beb442f0eb3ef1d2b69b10638 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Sat, 12 Dec 2020 22:51:18 +0100 Subject: Use env variables to generalize GitHub workflow --- .github/workflows/ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f4ecc6a..8b9ac480 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,11 @@ on: pull_request: branches: [ master ] +env: + DOCKERHUB_USER: hildan + DOCKER_IMAGE_NAME: seven-wonders-server + HEROKU_APP_NAME: seven-wonders-online + jobs: build: runs-on: ubuntu-latest @@ -44,7 +49,7 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v1 with: - username: hildan + username: ${{ env.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GitHub Container Registry @@ -68,6 +73,6 @@ jobs: file: ./sw-server/Dockerfile push: true tags: | - hildan/seven-wonders-server:latest - ghcr.io/joffrey-bion/seven-wonders-server:latest - registry.heroku.com/seven-wonders-online/web + ${{ env.DOCKERHUB_USER }}/${{ env.DOCKER_IMAGE_NAME }}:latest + ghcr.io/${{ github.repository_owner }}/${{ env.DOCKER_IMAGE_NAME }}:latest + registry.heroku.com/${{ env.HEROKU_APP_NAME }}/web -- cgit