mirror of
https://github.com/kremalicious/blog.git
synced 2025-01-03 18:35:07 +01:00
add S3 deployment
This commit is contained in:
parent
354c1b67a7
commit
fc5e273479
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -47,23 +47,42 @@ jobs:
|
||||
|
||||
- name: Cache Gatsby Cache Folder
|
||||
uses: actions/cache@v1
|
||||
id: gatsby-cache-folder
|
||||
with:
|
||||
path: .cache
|
||||
key: ${{ runner.os }}-cache-gatsby
|
||||
restore-keys: |
|
||||
${{ runner.os }}-cache-gatsby
|
||||
restore-keys: ${{ runner.os }}-cache-gatsby
|
||||
|
||||
- name: Cache Gatsby Public Folder
|
||||
uses: actions/cache@v1
|
||||
id: gatsby-public-folder
|
||||
with:
|
||||
path: public/
|
||||
key: ${{ runner.os }}-public-gatsby
|
||||
restore-keys: |
|
||||
${{ runner.os }}-public-gatsby
|
||||
restore-keys: ${{ runner.os }}-public-gatsby
|
||||
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
env:
|
||||
GATSBY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GATSBY_MAPBOX_ACCESS_TOKEN: ${{ secrets.GATSBY_MAPBOX_ACCESS_TOKEN }}
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
name: public
|
||||
path: public
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
if: success() && github.ref == 'refs/heads/main'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: public
|
||||
- name: Deploy to S3
|
||||
run: ./scripts/deploy-s3.sh
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
|
Loading…
Reference in New Issue
Block a user