Skip to content

Commit

Permalink
Build files, cleanup if statements with an env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
DanVanAtta committed Jul 10, 2024
1 parent f04d355 commit 904bc6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
- master
jobs:
build:
env:
IS_MASTER_BUILD: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,19 +28,19 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ env.IS_MASTER_BUILD }}
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build database docker container
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ env.IS_MASTER_BUILD }}
run: |
docker build database/sql --tag ghcr.io/triplea-game/lobby/flyway:latest
docker push ghcr.io/triplea-game/lobby/flyway:latest
- name: build server docker container
if: ${{ github.ref == 'refs/heads/master' }}
if: ${{ env.IS_MASTER_BUILD }}
run: |
docker build . --tag ghcr.io/triplea-game/lobby/server:latest
docker push ghcr.io/triplea-game/lobby/server:latest
Expand Down

0 comments on commit 904bc6e

Please sign in to comment.