Skip to content

Update wish-list.yaml #95

Update wish-list.yaml

Update wish-list.yaml #95

Workflow file for this run

name: Create site release
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12'
- name: Install dependencies
run: npm ci
- name: Build site
run: >-
export NODE_ENV=prod;
export YOUTUBE_API_KEY=${{ secrets.YOUTUBE_API_KEY }};
npm run build
- name: Create build.tar.gz
run: cd build && tar -cvzf ../build.tar.gz . && cd ..
- uses: actions/upload-artifact@v1
with:
name: build.tar.gz
path: build.tar.gz
create_release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Create build tag
id: tag_version
uses: mathieudutour/github-tag-action@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Store upload URL
run: echo -n "${{ steps.create_release.outputs.upload_url }}" > upload-url.txt
- uses: actions/upload-artifact@v1
with:
name: upload-url.txt
path: upload-url.txt
attach_build:
needs:
- build
- create_release
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v2
- name: Get upload URL
id: upload_url
run: cat upload-url.txt/upload-url.txt | xargs -I{} echo "::set-output name=val::{}"
- name: Attach release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload_url.outputs.val }}
asset_path: build.tar.gz/build.tar.gz
asset_name: build.tar.gz
asset_content_type: application/gzip
deploy:
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v2
with:
name: build.tar.gz
path: build
- name: Unpack build
run: cd build && tar -xzvf build.tar.gz && rm build.tar.gz
- name: Get deploy key
run: echo "${{ secrets.DEPLOY_KEY }}" > deploy_key && chmod 600 deploy_key
- name: Copy files
run: rsync -av --delete -e "ssh -oStrictHostKeyChecking=accept-new -i deploy_key" "build/" "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/var/www"