mirror of
https://github.com/kremalicious/blog.git
synced 2025-01-05 11:25: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
|
- name: Cache Gatsby Cache Folder
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
id: gatsby-cache-folder
|
|
||||||
with:
|
with:
|
||||||
path: .cache
|
path: .cache
|
||||||
key: ${{ runner.os }}-cache-gatsby
|
key: ${{ runner.os }}-cache-gatsby
|
||||||
restore-keys: |
|
restore-keys: ${{ runner.os }}-cache-gatsby
|
||||||
${{ runner.os }}-cache-gatsby
|
|
||||||
|
|
||||||
- name: Cache Gatsby Public Folder
|
- name: Cache Gatsby Public Folder
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
id: gatsby-public-folder
|
|
||||||
with:
|
with:
|
||||||
path: public/
|
path: public/
|
||||||
key: ${{ runner.os }}-public-gatsby
|
key: ${{ runner.os }}-public-gatsby
|
||||||
restore-keys: |
|
restore-keys: ${{ runner.os }}-public-gatsby
|
||||||
${{ runner.os }}-public-gatsby
|
|
||||||
|
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
env:
|
env:
|
||||||
GATSBY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
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