Skip to content

Commit

Permalink
Add deploy_to_s3 job
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor committed May 30, 2024
1 parent efc5e6a commit eb9f4f8
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/deploy-to-gh-pages.yml

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Deploy
on:
workflow_dispatch:

push:
branches:
- main
paths:
- '.github/workflows/deploy.yml'
- 'metadata/*'
- 'store/*'

workflow_run:
workflows:
- "Update dictionary manifest"
- "Update hook manifest"
branches: [main]
types:
- completed

permissions:
contents: write

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- 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

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

- 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

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

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

0 comments on commit eb9f4f8

Please sign in to comment.