mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-08 22:46:31 +08:00
GitHub files
This commit is contained in:
43
.github/workflows/do-spaces-workflow.yml
vendored
Normal file
43
.github/workflows/do-spaces-workflow.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Test and Deploy to DigitalOcean Spaces
|
||||
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Read .nvmrc
|
||||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
||||
id: nvm
|
||||
|
||||
- name: Use Node.js (.nvmrc)
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
||||
|
||||
- name: npm ci, test, and build
|
||||
run: |
|
||||
npm ci
|
||||
npm test
|
||||
npm run build
|
||||
env:
|
||||
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
||||
|
||||
- name: Deploy commit to DigitalOcean Spaces
|
||||
run: aws s3 sync ./dist s3://${{ secrets.SPACES_BUCKET }}/commits/available-images/${{ github.sha }} --endpoint=https://${{ secrets.SPACES_REGION }}.digitaloceanspaces.com --acl public-read --content-encoding utf8
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.SPACES_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.SPACES_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: ${{ secrets.SPACES_REGION }}
|
||||
|
||||
- name: Leave a comment
|
||||
run: npm run deploy:spaces:comment
|
||||
env:
|
||||
REPO_NAME: ${{ github.repository }}
|
||||
COMMIT_SHA: ${{ github.sha }}
|
||||
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SPACES_REGION: ${{ secrets.SPACES_REGION }}
|
||||
SPACES_BUCKET: ${{ secrets.SPACES_BUCKET }}
|
38
.github/workflows/gh-pages-workflow.yml
vendored
Normal file
38
.github/workflows/gh-pages-workflow.yml
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
name: Test and Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Read .nvmrc
|
||||
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
|
||||
id: nvm
|
||||
|
||||
- name: Use Node.js (.nvmrc)
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: "${{ steps.nvm.outputs.NVMRC }}"
|
||||
|
||||
- name: npm ci, test, and build
|
||||
run: |
|
||||
npm ci
|
||||
npm test
|
||||
npm run build
|
||||
env:
|
||||
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
||||
|
||||
- name: Deploy master to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@2.0.0
|
||||
env:
|
||||
ACCESS_TOKEN: ${{ secrets.DEV_GITHUB_TOKEN }}
|
||||
BASE_BRANCH: master
|
||||
BRANCH: gh-pages
|
||||
FOLDER: dist
|
Reference in New Issue
Block a user