Skip to content

Commit

Permalink
Merge pull request #107 from haroldtreen/stage
Browse files Browse the repository at this point in the history
Fix deploy pipeline
  • Loading branch information
haroldtreen authored Jul 17, 2023
2 parents 60eb928 + 75ca27b commit 8be475c
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ jobs:
needs: [test_and_lint]
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Docker
uses: docker/build-push-action@v1
uses: docker/build-push-action@v4
with:
repository: haroldtreen/epub-press/server
registry: docker.pkg.github.com
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tag_with_ref: true
context: .
tags: latest,master
cache_froms: haroldtreen/epub-press/server:latest
build-args: converter=kindlegen
cache-from: haroldtreen/epub-press/server:latest
deploy_stage:
if: ${{ contains(github.ref, 'stage') }}
runs-on: ubuntu-latest
Expand All @@ -47,12 +50,11 @@ jobs:
env:
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Copy files
uses: appleboy/scp-action@master
env:
HOST: ${{ env.STAGE_HOST }}
USERNAME: ${{ secrets.SSH_USERNAME }}
KEY: ${{ secrets.SSH_KEY }}
uses: appleboy/[email protected]
with:
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
host: ${{ env.STAGE_HOST }}
source: "docker-compose.stage.yaml,envs/stage.env,prometheus.yml"
target: "/usr/local/epub-press"
passphrase: ${{ secrets.SSH_PASSPHRASE }}
Expand Down Expand Up @@ -80,12 +82,11 @@ jobs:
env:
PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Copy files
uses: appleboy/scp-action@master
env:
HOST: ${{ env.PROD_HOST }}
USERNAME: ${{ secrets.SSH_USERNAME }}
KEY: ${{ secrets.SSH_KEY }}
uses: appleboy/[email protected]
with:
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
host: ${{ env.STAGE_HOST }}
source: "docker-compose.prod.yaml,envs/prod.env,prometheus.yml"
target: "/usr/local/epub-press"
passphrase: ${{ secrets.SSH_PASSPHRASE }}
Expand Down

0 comments on commit 8be475c

Please sign in to comment.