ci: move deploy step to another workflow to keep repository secrets safe

This commit is contained in:
Fernando Fernández 2022-11-14 00:35:45 +01:00
parent 60ccaeff40
commit eceeab5f8e
3 changed files with 45 additions and 26 deletions

View File

@ -213,10 +213,3 @@ jobs:
with:
name: jellyfin-vue_windows_amd64
path: tauri/target/release/jellyfin-vue.exe
deploy:
uses: ./.github/workflows/deploy.yml
with:
os: 'linux'
architectures: '["amd64", "arm64"]'
release: false

39
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Deploy 🏗️
on:
workflow_run:
workflows: |
- Quality Checks 👌🧪
types:
- completed
workflow_call:
inputs:
workflow_run:
description: Run ID of the workflow whose artifacts are going to be downloaded
required: true
type: string
branch:
description: Name of the branch that it's being deployed
required: true
type: string
jobs:
cf-pages:
name: CloudFlare Pages 📃
runs-on: ubuntu-latest
steps:
- name: Download workflow artifact ⬇️
uses: dawidd6/action-download-artifact@v2.24.2
with:
run_id: ${{ github.event.workflow_run.run_id }}
- name: Publish to Cloudflare Pages 📃
uses: cloudflare/pages-action@v1.1.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: jf-vue
directory: dist
branch: ${{ github.event.workflow_run.head_branch }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

View File

@ -132,23 +132,10 @@ jobs:
name: jellyfin-vue_windows_amd64
path: tauri/target/release/jellyfin-vue.exe
cf-pages:
name: Publish to CloudFlare Pages 📃
runs-on: 'ubuntu-latest'
deploy:
name: Start deployment
uses: ./.github/workflows/deploy.yml
needs: docker
steps:
- name: Download client artifact ⬇️
uses: actions/download-artifact@v3.0.1
with:
name: client
path: dist
- name: Publish to Cloudflare Pages 📃
uses: cloudflare/pages-action@v1.1.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: jf-vue
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
with:
workflow_run: ${{ github.run_id }}
branch: ${{ github.head_ref }}