Skip to content

Commit

Permalink
Simplify github pages deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed May 31, 2024
1 parent 0205228 commit 9fef848
Showing 1 changed file with 37 additions and 41 deletions.
78 changes: 37 additions & 41 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,57 +25,53 @@ jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Prepare to deploy
run: |
mkdir deploy
cp -r metadata deploy/metadata
cp -r store deploy/store
touch deploy/.nojekyll
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: update-data
path: deploy
- name: Prepare to deploy
run: |
mkdir deploy
cp -r metadata deploy/metadata
cp -r store deploy/store
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: update-data
path: deploy

deploy_to_gh_pages:
runs-on: ubuntu-latest
needs: prepare
steps:
- uses: actions/checkout@v4

- name: Download artifact
uses: actions/download-artifact@v3
with:
name: update-data
path: deploy
permissions:
pages: write
id-token: write

- name: Deploy to Github Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
git-config-name: github-actions[bot]
git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
folder: deploy
single-commit: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

deploy_to_s3:
runs-on: ubuntu-latest
needs: prepare
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: update-data
path: deploy
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: update-data
path: deploy

- name: Upload to S3
uses: shallwefootball/[email protected]
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ vars.AWS_BUCKET }}
source_dir: deploy
destination_dir: update-data
endpoint: ${{ vars.S3_ENDPOINT }}
- name: Upload to S3
uses: shallwefootball/[email protected]
with:
aws_key_id: ${{ secrets.AWS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: ${{ vars.AWS_BUCKET }}
source_dir: deploy
destination_dir: update-data
endpoint: ${{ vars.S3_ENDPOINT }}

0 comments on commit 9fef848

Please sign in to comment.