ci: tweak docker and release workflows
This commit is contained in:
parent
ca4aa795be
commit
a2970cd784
2 changed files with 13 additions and 22 deletions
29
.github/workflows/docker.yaml
vendored
29
.github/workflows/docker.yaml
vendored
|
@ -1,22 +1,25 @@
|
|||
name: Publish Docker Image
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- 1.0-develop
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- 1.0-develop
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
push:
|
||||
name: Push Image to GitHub Packages
|
||||
name: Push
|
||||
runs-on: ubuntu-20.04
|
||||
# Always run against a tag, even if the commit into the tag has [docker skip]
|
||||
# within the commit message.
|
||||
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
|
||||
steps:
|
||||
- name: Code Checkout
|
||||
- name: Code checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Docker metadata
|
||||
|
@ -44,25 +47,13 @@ jobs:
|
|||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Update app.php version
|
||||
- name: Update version
|
||||
if: "github.event_name == 'release' && github.event.action == 'published'"
|
||||
run: |
|
||||
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php
|
||||
|
||||
- name: Build and Push (tag)
|
||||
- name: Build and Push
|
||||
uses: docker/build-push-action@v3
|
||||
if: "github.event_name == 'release' && github.event.action == 'published'"
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||
tags: ${{ steps.docker_meta.outputs.tags }}
|
||||
|
||||
- name: Build and Push (develop)
|
||||
uses: docker/build-push-action@v3
|
||||
if: "github.event_name == 'push' && contains(github.ref, 'develop')"
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
|
|
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
|
@ -36,13 +36,13 @@ jobs:
|
|||
git push -u origin $BRANCH
|
||||
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php
|
||||
git add config/app.php
|
||||
git commit -m "bump version for release"
|
||||
git commit -m "ci(release): bump version"
|
||||
git push
|
||||
|
||||
- name: Create release archive
|
||||
run: |
|
||||
rm -rf node_modules/ test/ codecov.yml CODE_OF_CONDUCT.md CONTRIBUTING.md phpunit.xml Vagrantfile
|
||||
tar -czf panel.tar.gz * .env.example .eslintignore .eslintrc.js
|
||||
rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix
|
||||
tar -czf panel.tar.gz * .editorconfig .env.example .eslintignore .eslintrc.js .gitignore .prettierrc.json
|
||||
|
||||
- name: Extract changelog
|
||||
env:
|
||||
|
|
Loading…
Reference in a new issue