From 6d4266fe928ab06d20ef5a7716d02b92324db678 Mon Sep 17 00:00:00 2001 From: Jan Max Tiedemann Date: Thu, 20 Jul 2023 21:34:03 +0200 Subject: [PATCH] fix job dependencies --- .github/workflows/pixel.yaml | 38 +++++++++++++++++++++++++++++++- .github/workflows/static.yml | 42 ------------------------------------ bin/{generate.sh => run.sh} | 0 3 files changed, 37 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/static.yml rename bin/{generate.sh => run.sh} (100%) diff --git a/.github/workflows/pixel.yaml b/.github/workflows/pixel.yaml index 2ccdb8a2..2329e304 100644 --- a/.github/workflows/pixel.yaml +++ b/.github/workflows/pixel.yaml @@ -7,6 +7,19 @@ on: pull_request: branches: - 'main' + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + jobs: generate: runs-on: ubuntu-latest @@ -24,4 +37,27 @@ jobs: - name: Commit & Push changes uses: actions-js/push@master with: - github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + github_token: ${{ secrets.GITHUB_TOKEN }} + - run: git rev-parse HEAD + + # Single deploy job since we're just deploying + deploy: + needs: generate + if: github.event_name != 'pull_request' + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - run: git rev-parse HEAD + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: './outputs/' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 \ No newline at end of file diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml deleted file mode 100644 index 49bbb966..00000000 --- a/.github/workflows/static.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["main"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Pages - uses: actions/configure-pages@v3 - - name: Upload artifact - uses: actions/upload-pages-artifact@v2 - with: - path: './outputs/' - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 diff --git a/bin/generate.sh b/bin/run.sh similarity index 100% rename from bin/generate.sh rename to bin/run.sh