Update sponsorships page #33
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 | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Build and deploy image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Get latest tag | |
uses: actions-ecosystem/action-get-latest-tag@v1 | |
id: get-latest-tag | |
- name: Build Docker image | |
run: | | |
touch .env | |
echo "${{ secrets.ENV_FILE }}" > .env | |
docker build . -t carberra/website:${{ steps.get-latest-tag.outputs.tag }} | |
docker save -o carberra-website.tar carberra/website:${{ steps.get-latest-tag.outputs.tag }} | |
- name: SCP image to server | |
uses: appleboy/scp-action@v0.1.3 | |
with: | |
username: parafoxia | |
host: ${{ secrets.HOST }} | |
key: ${{ secrets.PRIVATE_KEY }} | |
source: 'carberra-website.tar' | |
target: '/tmp/carberra-website' | |
rm: true | |
- name: Run deploy script via SSH | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.HOST }} | |
username: parafoxia | |
key: ${{ secrets.PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
script: | | |
docker stop carberra-website | |
docker load --input /tmp/carberra-website/carberra-website.tar | |
docker run -p 127.0.0.1:3000:3000 --name carberra-website --rm -d carberra/website:${{ steps.get-latest-tag.outputs.tag }} |