main not master #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Silo | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
type: string | |
required: false | |
default: main | |
description: Enter the tag to deploy | |
push: | |
branches: | |
- 'main' | |
jobs: | |
build-frontend: | |
runs-on: ubuntu-latest | |
name: 'Build Frontend' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: ./ui/.nvmrc | |
- working-directory: ./ui | |
run: | | |
npm ci | |
npm run build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: 'ui-dist' | |
path: ui/dist | |
glob: | |
runs-on: ubuntu-latest | |
name: 'Make a glob' | |
needs: build-frontend | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: 'ui-dist' | |
path: ui/dist | |
- name: 'glob' | |
uses: ./.github/actions/glob | |
with: | |
folder: 'ui/dist/*' | |
docket: 'desk/desk.docket-0' | |
access_key: ${{ secrets.S3_ACCESS_KEY }} | |
secret_key: ${{ secrets.S3_SECRET_KEY }} | |
- name: Commit and Push Glob | |
run: | | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
git add desk/desk.docket-0 | |
git commit -n -m "update glob: ${{ steps.glob.outputs.hash }} [skip actions]" || echo "No changes to commit" | |
INPUT=${{ github.event.inputs.tag }} | |
BRANCH=${INPUT:-"main"} | |
git pull origin $BRANCH --rebase --autostash | |
git push | |
deploy: | |
runs-on: ubuntu-latest | |
needs: glob | |
name: "Deploy silo to live" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- id: deploy | |
name: Deploy | |
run: | |
./.github/helpers/deploy.sh arthyn/silo silo urbit/dister-nocsyx-lassul ${{ github.event.inputs.tag }} | |
env: | |
SSH_SEC_KEY: ${{ secrets.SSH_SEC_KEY }} | |
SSH_PUB_KEY: ${{ secrets.SSH_PUB_KEY }} | |
URBIT_REPO_TAG: ${{ vars.URBIT_REPO_TAG }} |