Skip to content

Commit 788a3bd

Browse files
authored
ci: switch to deploy-pages
1 parent 8066c6e commit 788a3bd

File tree

1 file changed

+10
-29
lines changed

1 file changed

+10
-29
lines changed

Diff for: .github/workflows/build-and-deploy.yml

+10-29
Original file line numberDiff line numberDiff line change
@@ -58,41 +58,22 @@ jobs:
5858
npx sscli --no-clean --base https://gbdev.io/gb-asm-tutorial
5959
6060
- name: Store final build
61-
uses: actions/upload-artifact@v4
61+
uses: actions/upload-pages-artifact@v3
6262
with:
6363
name: Build output
6464
path: gb-asm-tutorial/book/custom/
6565
if-no-files-found: error
6666

6767
deploy:
68+
name: Deploy to GitHub pages
69+
# Do not run this unless *pushing* to `master`.
70+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
71+
environment:
72+
name: github-pages
73+
url: ${{ steps.deployment.outputs.page_url }}
6874
runs-on: ubuntu-latest
6975
needs: build
70-
# Do not run this unless *pushing* (`heads`) to `master`
71-
if: github.ref == 'refs/heads/master'
7276
steps:
73-
- name: Checkout gb-asm-tutorial/gh-pages
74-
uses: actions/checkout@v2
75-
with:
76-
path: gb-asm-tutorial
77-
ref: gh-pages
78-
79-
- name: Delete all current files
80-
run: |
81-
rm -vrf gb-asm-tutorial/*
82-
83-
- name: Unpack build
84-
uses: actions/download-artifact@v4
85-
with:
86-
name: Build output
87-
path: gb-asm-tutorial/
88-
89-
- name: Deploy
90-
working-directory: gb-asm-tutorial/
91-
run: |
92-
git config --local user.name "GitHub Action"
93-
git config --global user.email "[email protected]"
94-
git remote -v
95-
git branch -v
96-
git add -A
97-
git commit -am 'Update build'
98-
git push -v
77+
- name: Deploy to GitHub Pages
78+
id: deployment
79+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)