?argh?
This commit is contained in:
parent
a133e7f655
commit
a38c0a1c1f
2 changed files with 32 additions and 51 deletions
51
.github/workflows/publish.yml
vendored
51
.github/workflows/publish.yml
vendored
|
@ -1,51 +0,0 @@
|
|||
name: Publish
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: Tests
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
types: completed
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'branch-2.*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
|
||||
steps:
|
||||
- name: Checkout triggering commit
|
||||
if: ${{ github.event_name == 'workflow_run' }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.workflow_run.head_sha }}
|
||||
fetch-tags: true
|
||||
fetch-depth: 0
|
||||
- name: Checkout main commit
|
||||
if: ${{ github.event_name != 'workflow_run' }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-tags: true
|
||||
fetch-depth: 0
|
||||
- name: Set build vars
|
||||
run: |
|
||||
echo "BUILD_TIME=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
|
||||
echo "BUILD_HASH=$GITHUB_SHA" >> $GITHUB_ENV
|
||||
- name: Get tags
|
||||
id: get-tags
|
||||
shell: bash
|
||||
run: ./.github/get-tags.py >> $GITHUB_OUTPUT
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@main
|
||||
with:
|
||||
name: shish2k/shimmie2
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
cache: ${{ github.event_name != 'schedule' }}
|
||||
buildoptions: "--build-arg RUN_TESTS=false"
|
||||
buildargs: BUILD_TIME,BUILD_HASH
|
||||
tags: "${{ steps.get-tags.outputs.tags }}"
|
32
.github/workflows/tests.yml
vendored
32
.github/workflows/tests.yml
vendored
|
@ -138,3 +138,35 @@ jobs:
|
|||
run: composer install --no-progress
|
||||
- name: Run test suite
|
||||
run: composer test
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- format
|
||||
- static
|
||||
- upgrade
|
||||
- test
|
||||
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/branch-2')
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-tags: true
|
||||
fetch-depth: 0
|
||||
- name: Set build vars
|
||||
id: get-vars
|
||||
run: |
|
||||
echo "BUILD_TIME=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
|
||||
echo "BUILD_HASH=$GITHUB_SHA" >> $GITHUB_ENV
|
||||
./.github/get-tags.py | tee -a $GITHUB_OUTPUT
|
||||
- name: Publish to Registry
|
||||
uses: elgohr/Publish-Docker-Github-Action@main
|
||||
with:
|
||||
name: shish2k/shimmie2
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
cache: ${{ github.event_name != 'schedule' }}
|
||||
buildoptions: "--build-arg RUN_TESTS=false"
|
||||
buildargs: BUILD_TIME,BUILD_HASH
|
||||
tags: "${{ steps.get-vars.outputs.tags }}"
|
||||
|
|
Reference in a new issue