-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.67 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Deploy
# This workflow is triggered manually.
# It deploys the app to GitHub Pages and optionally updates proof.market repository.
on:
workflow_dispatch:
inputs:
update-proof-market:
type: boolean
default: true
description: Update proof.market repository also
commit:
description: 'Commit SHA1'
required: false
default: ''
type: string
jobs:
build:
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
environment: github-pages
commit: ${{ inputs.commit || github.sha }}
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: github-pages
needs: [build]
steps:
- uses: actions/download-artifact@v3
with:
name: build-${{ github.sha }}
- name: Extract build results
run: tar -xf build-${{ github.sha }}.tar.gz
- name: Deploy app
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
- name: Overwrite CNAME for proof.market repository
if: ${{ inputs.update-proof-market }}
run: echo ${{ secrets.PROOF_MARKET_REPO_DOMAIN }} > 'build/CNAME'
- name: Update proof.market repository
if: ${{ inputs.update-proof-market }}
uses: cpina/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.PROOF_MARKET_REPO_PUSH_TOKEN }}
with:
source-directory: 'build'
destination-github-username: ${{ secrets.PROOF_MARKET_REPO_OWNER }}
destination-repository-name: ${{ secrets.PROOF_MARKET_REPO_NAME }}
target-branch: gh-pages