-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy branches to S3 #33
Labels
Comments
Here's an example of deploying a branch which can be adapted for the current PR builder name: Pull Request Deploy
on:
pull_request:
branches:
- main
jobs:
deploy-pr:
name: Deploy PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2.5.1
with:
node-version: 15.11.0
cache: npm
- name: NPM Install
run: npm install
build:
name: Build and Deploy
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PR_DEPLOYMENT_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PR_DEPLOYMENT_AWS_ACCESS_KEY_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2.5.1
with:
node-version: 15.11.0
cache: npm
- name: NPM Install
run: npm install
- name: NPM Build
run: npm run build
- name: Deploy S3 Website
uses: danburtenshaw/s3-website-pr-action@v2
with:
bucket-prefix: "vapor-blog-pulls"
folder-to-copy: "./build" |
Then we'll need another workflow for cleanups name: PR - Closed
on:
pull_request:
branches:
- main
- dev
types: [closed]
jobs:
delete-s3:
name: Delete S3 Website
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.PR_DEPLOYMENT_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.PR_DEPLOYMENT_AWS_ACCESS_KEY_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Delete Website Bucket
uses: danburtenshaw/s3-website-pr-action@v2
with:
bucket-prefix: "vapor-blog-pulls" |
0xTim
added
good first issue
Good for newcomers
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Mar 29, 2022
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since the blog is just a static site we should deploy PRs to an S3 bucket. This allows us to see new posts before they are merged, any style changes etc and will work as a test bed for similar functionality in the website.
I have examples of how to do this so it's not a big task
The text was updated successfully, but these errors were encountered: