Skip to content

Move permissions inside of jobs #2

Move permissions inside of jobs

Move permissions inside of jobs #2

name: Build and push nginx to GHCR, Deploy to Pages
on:
push:
branches-ignore:
- wip/*
jobs:
build-push-ghcr:
uses: ./.github/workflows/express-ghcr.yml
with:
tag: ${{ github.ref_name }}
deploy-pages:
needs: build-push-ghcr
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Export static files
run: >
mkdir -p nginx/pages
&& docker cp $(docker create ${{ needs.build-push-ghcr.outputs.stream-image }}):/var/www/html nginx/pages
shell: sh
- if: ${{ !env.ACT }}
name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: nginx/pages
- if: ${{ !env.ACT }}
name: Deploy Pages
id: deployment
uses: actions/deploy-pages@v2