Merge pull request #661 from podverse/develop #469
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: master-branch | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Read node from package.json | |
uses: culshaw/read-package-node-version-actions@v1 | |
id: package-node-version | |
- name: build and push docker image | |
uses: docker/build-push-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
repository: podverse/podverse_api | |
tags: latest,${{ steps.package-node-version.outputs.version }} | |
- name: Tailscale | |
uses: tailscale/github-action@main | |
with: | |
authkey: ${{ secrets.TAILSCALE_AUTHKEY }} | |
- name: log into prod, then deploy latest prod image | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.PROD_SSH_HOST }} | |
username: ${{ secrets.PROD_SSH_USERNAME }} | |
passphrase: ${{ secrets.PROD_SSH_PASSPHRASE }} | |
key: ${{ secrets.PROD_SSH_PRIVATE_KEY }} | |
command_timeout: 60m | |
script: | | |
docker stop podverse_api_prod | |
docker rm podverse_api_prod | |
docker image rm podverse/podverse_api:latest | |
docker-compose -f /opt/podverse-ops/docker-compose/prod/srv/docker-compose.yml up -d podverse_api |