From 64506157009f6ff9084e58f11d21497f9dfedef4 Mon Sep 17 00:00:00 2001 From: Daniel Mapleson Date: Thu, 23 Feb 2023 10:08:59 +0000 Subject: [PATCH] Updating github workflow --- .github/workflows/branch_ci.yml | 16 +++++++++++ .github/workflows/build.yml | 40 ---------------------------- .github/workflows/create_release.yml | 23 ++++++++++++++++ .github/workflows/publish.yml | 36 ------------------------- 4 files changed, 39 insertions(+), 76 deletions(-) create mode 100644 .github/workflows/branch_ci.yml delete mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/branch_ci.yml b/.github/workflows/branch_ci.yml new file mode 100644 index 0000000..ff83426 --- /dev/null +++ b/.github/workflows/branch_ci.yml @@ -0,0 +1,16 @@ +name: Feature Branch CI + +on: + push: + branches-ignore: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Build and test the Docker image + run: docker build . --file Dockerfile --tag sbastkowski/quatradis:$(date +%s) + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 7bb6e2f..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build - -on: - push: - branches-ignore: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Build the Docker image - run: docker build . --file Dockerfile --tag sbastkowski/quatradis:$(date +%s) - - publish: - needs: build - runs-on: ubuntu-latest - steps: - - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: sbastkowski/quatradis - -# - name: Build and push Docker image -# uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc -# with: -# context: . -# push: true -# tags: ${{ steps.meta.outputs.tags }} -# labels: ${{ steps.meta.outputs.labels }} - diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index d512485..372488d 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -2,6 +2,7 @@ name: Create Github Release on: push: + branches: [ "master" ] tags: - '*' @@ -10,8 +11,10 @@ jobs: name: Create Release runs-on: ubuntu-latest steps: + - name: Checkout code uses: actions/checkout@v2 + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -22,3 +25,23 @@ jobs: release_name: Release ${{ github.ref }} draft: false prerelease: false + + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 + with: + images: sbastkowski/quatradis + + - name: Build and push Docker image + uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 6c3f74a..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish - -on: - workflow_run: - workflows: [ "Build" ] - types: - - completed - push: - branches: [ 'master' ] - pull_request: - branches: [ "*" ] - - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - name: Log in to Docker Hub - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: sbastkowski/quatradis - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file