Added versions to docker tags
This commit is contained in:
parent
f0be4ce391
commit
b9f0d013b6
37
.github/workflows/build.yaml
vendored
37
.github/workflows/build.yaml
vendored
@ -5,43 +5,56 @@ on:
|
|||||||
push:
|
push:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
version:
|
||||||
|
name: Get Version Number
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: node
|
||||||
|
outputs:
|
||||||
|
VERSION: ${{ steps.extract-version.outputs.VERSION }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Extract Version
|
||||||
|
id: extract-version
|
||||||
|
run: |
|
||||||
|
VERSION=$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+')
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Build & Push Dockerfile
|
name: Build & Push Dockerfile
|
||||||
|
needs: version
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: node
|
container: node
|
||||||
steps:
|
steps:
|
||||||
- name: Get Version Number
|
- name: Checkout
|
||||||
run: echo "VERSION=$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Push Version
|
- name: Push Version
|
||||||
uses: ztimson/actions/.github/workflows/docker.yaml@develop
|
uses: ztimson/actions/.github/workflows/docker.yaml@develop
|
||||||
with:
|
with:
|
||||||
name: ztimson/caddy-labels:${{env.VERSION}}
|
name: ztimson/caddy-labels:${{ needs.version.outputs.VERSION }}
|
||||||
repository: ${{github.server_url}}/${{github.repository}}.git
|
repository: ${{ github.server_url }}/${{ github.repository }}.git
|
||||||
pass: ${{secrets.DEPLOY_TOKEN}}
|
pass: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
|
|
||||||
- name: Push Latest
|
- name: Push Latest
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
uses: ztimson/actions/.github/workflows/docker.yaml@develop
|
uses: ztimson/actions/.github/workflows/docker.yaml@develop
|
||||||
with:
|
with:
|
||||||
name: ztimson/caddy-labels:latest
|
name: ztimson/caddy-labels:latest
|
||||||
repository: ${{github.server_url}}/${{github.repository}}.git
|
repository: ${{ github.server_url }}/${{ github.repository }}.git
|
||||||
pass: ${{secrets.DEPLOY_TOKEN}}
|
pass: ${{ secrets.DEPLOY_TOKEN }}
|
||||||
|
|
||||||
tag:
|
tag:
|
||||||
name: Tag Version
|
name: Tag Version
|
||||||
needs: publish
|
needs: [version, publish]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: node
|
container: node
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Repository
|
- name: Clone Repository
|
||||||
uses: ztimson/actions/clone@develop
|
uses: ztimson/actions/clone@develop
|
||||||
|
|
||||||
- name: Get Version Number
|
|
||||||
run: echo "VERSION=$(cat Dockerfile | grep "ARG CADDY_VERSION" | grep -Eo '=.+' | grep -Eo '[[:alnum:]\.\/\-]+')" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Tag Version
|
- name: Tag Version
|
||||||
uses: ztimson/actions/tag@develop
|
uses: ztimson/actions/tag@develop
|
||||||
with:
|
with:
|
||||||
tag: ${{env.VERSION}}
|
tag: ${{ needs.version.outputs.VERSION }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user