Changing Workflow Job
This commit is contained in:
39
.github/workflows/deploy.yml
vendored
39
.github/workflows/deploy.yml
vendored
@@ -4,29 +4,26 @@ on:
|
|||||||
branches: main
|
branches: main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bump-version:
|
release-on-push:
|
||||||
name: Bump version number
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
ver: ${{ steps.ver.outputs.version }}
|
ver: ${{ steps.release.outputs.version }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- id: bump
|
- id: release
|
||||||
uses: zwaldowski/match-label-action@v1
|
uses: rymndhng/release-on-push-action@master
|
||||||
with:
|
with:
|
||||||
bump: ${{ steps.bump.outputs.match }}
|
bump_version_scheme: minor
|
||||||
allowed: >
|
|
||||||
major
|
- name: Check Output Parameters
|
||||||
minor
|
run: |
|
||||||
patch
|
echo "Got tag name ${{ steps.release.outputs.tag_name }}"
|
||||||
- id: ver
|
echo "Got release version ${{ steps.release.outputs.version }}"
|
||||||
uses: zwaldowski/semver-release-action@v1
|
|
||||||
with:
|
|
||||||
bump: ${{ steps.bump.outputs.match }}
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
docker-dh:
|
docker-dh:
|
||||||
name: Push to Docker Hub
|
name: Push to Docker Hub
|
||||||
needs: [bump-version]
|
needs: [release-on-push]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -34,18 +31,18 @@ jobs:
|
|||||||
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
|
||||||
- name: Build image for Docker Hub
|
- name: Build image for Docker Hub
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.bump-version.output.ver }}
|
VERSION: ${{ needs.release-on-push.output.ver }}
|
||||||
run: docker build . --file Dockerfile --tag luketainton/fhed:$VERSION luketainton/fhed:latest
|
run: docker build . --file Dockerfile --tag luketainton/fhed:$VERSION luketainton/fhed:latest
|
||||||
- name: Push image to Docker Hub
|
- name: Push image to Docker Hub
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.bump-version.output.ver }}
|
VERSION: ${{ needs.release-on-push.output.ver }}
|
||||||
run: |
|
run: |
|
||||||
docker push luketainton/fhed:$VERSION &&
|
docker push luketainton/fhed:$VERSION &&
|
||||||
docker push luketainton/fhed:latest
|
docker push luketainton/fhed:latest
|
||||||
|
|
||||||
docker-ghr:
|
docker-ghr:
|
||||||
name: Push to GitHub Package Registry
|
name: Push to GitHub Package Registry
|
||||||
needs: [bump-version]
|
needs: [release-on-push]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -53,11 +50,11 @@ jobs:
|
|||||||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u luketainton --password-stdin
|
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u luketainton --password-stdin
|
||||||
- name: Build image for GitHub Package Registry
|
- name: Build image for GitHub Package Registry
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.bump-version.output.ver }}
|
VERSION: ${{ needs.release-on-push.output.ver }}
|
||||||
run: docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/fhed/fhed:latest docker.pkg.github.com/luketainton/fhed/fhed:$VERSION
|
run: docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/fhed/fhed:latest docker.pkg.github.com/luketainton/fhed/fhed:$VERSION
|
||||||
- name: Push image to GitHub Package Registry
|
- name: Push image to GitHub Package Registry
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ needs.bump-version.output.ver }}
|
VERSION: ${{ needs.release-on-push.output.ver }}
|
||||||
run: |
|
run: |
|
||||||
docker push docker.pkg.github.com/luketainton/fhed/fhed:$VERSION &&
|
docker push docker.pkg.github.com/luketainton/fhed/fhed:$VERSION &&
|
||||||
docker push docker.pkg.github.com/luketainton/fhed/fhed:latest
|
docker push docker.pkg.github.com/luketainton/fhed/fhed:latest
|
||||||
|
|||||||
Reference in New Issue
Block a user