From a2970cd7840b7224574740b66c78aad5f2a18390 Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 5 Dec 2022 09:58:13 -0700 Subject: [PATCH] ci: tweak docker and release workflows --- .github/workflows/docker.yaml | 29 ++++++++++------------------- .github/workflows/release.yaml | 6 +++--- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 85dcd4b0b..81d62f856 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3b5baa4c3..cbbb4b05e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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: