-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (108 loc) · 3.14 KB
/
deploy.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Catalyst Voices Updates
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Dart
uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: dart pub get
- name: Build site
run: dart run bin/main.dart
- name: Debug build directory
run: |
echo "Current directory contents:"
ls -la
echo "Build directory contents:"
ls -la build || echo "Build directory not found"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: build
deploy-production:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
deployments: write
statuses: write
contents: read
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: "pages"
cancel-in-progress: false
steps:
- name: Configure Pages
uses: actions/configure-pages@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: build
- name: Debug downloaded artifact
run: |
echo "Downloaded contents:"
ls -la build
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
with:
artifact_name: github-pages
# deploy-preview:
# needs: build
# if: github.event_name == 'pull_request'
# runs-on: ubuntu-latest
# permissions:
# pages: write
# id-token: write
# pull-requests: write
# deployments: write
# statuses: write
# contents: read
# environment:
# name: preview
# url: ${{ steps.deployment.outputs.page_url }}
# concurrency:
# group: "pages-pr-${{ github.event.pull_request.number }}"
# cancel-in-progress: true
# steps:
# - name: Configure Pages
# uses: actions/configure-pages@v4
# - name: Download artifact
# uses: actions/download-artifact@v4
# with:
# name: github-pages
# path: build
# - name: Deploy Preview
# id: deployment
# uses: actions/deploy-pages@v2
# with:
# artifact_name: github-pages
# - name: Add Preview URL Comment
# uses: actions/github-script@v6
# with:
# script: |
# const preview_url = `https://${context.repo.owner}.github.io/${context.repo.repo}/pr-preview/pr-${context.issue.number}`;
# github.rest.issues.createComment({
# owner: context.repo.owner,
# repo: context.repo.repo,
# issue_number: context.issue.number,
# body: `🚀 Preview deployment is ready!\nURL: ${preview_url}`
# })