From dad0cd00e69b92c661687ec57567b2347429e8ae Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 25 Apr 2020 16:59:51 +0100 Subject: [PATCH] Split docker and deploy workflows to avoid issues with conditionals --- .github/workflows/deploy.yml | 22 ++++++++++++++++++++++ .github/workflows/docker.yml | 10 +--------- 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..db00c30 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ +name: Docker + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v1 + + - name: Build container + run: docker build --tag docker.pkg.github.com/${GITHUB_REPOSITORY,,}/website:latest . + + - name: Log into GitHub Docker Registry + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY%/*} --password-stdin + + - name: Push the Docker container + run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY,,}/website:latest diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5ab6920..b562925 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,12 +10,4 @@ jobs: - uses: actions/checkout@v1 - name: Build container - run: docker build --tag docker.pkg.github.com/${GITHUB_REPOSITORY,,}/website:latest . - - - name: Log into GitHub Docker Registry - run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${GITHUB_REPOSITORY%/*} --password-stdin - if: github.ref == 'master' - - - name: Push the Docker container - run: docker push docker.pkg.github.com/${GITHUB_REPOSITORY,,}/website:latest - if: github.ref == 'master' + run: docker build .