-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa35e05
commit 881949b
Showing
1 changed file
with
8 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,29 +49,28 @@ jobs: | |
- name: Push images to repository | ||
run: make push ARGS="${REGISTRY}/" IMAGE_TAG="${IMAGE_SHA}" IMAGE_NAME=${IMAGE_NAME} | ||
|
||
Deploy: | ||
Deploy_test: | ||
runs-on: ubuntu-latest | ||
|
||
needs: Build | ||
needs: [ GetSHA, Build ] | ||
|
||
if: ${{ github.ref_type == 'branch' }} | ||
|
||
env: | ||
|
||
IMAGE_TAG: ${{ needs.GetSHA.outputs.IMAGE_SHA}} | ||
IMAGE_SHA: ${{ needs.GetSHA.outputs.IMAGE_SHA}} | ||
|
||
steps: | ||
- name: Deploy test | ||
- name: Deploy Test | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.REMOTE_HOST_TEST }} | ||
username: ubuntu | ||
key: ${{ secrets.SSH_PRIVATE_KEY_TEST }} | ||
port: 22 | ||
envs: GITHUB_ACTOR,SECRETS_GITHUB_TOKEN,IMAGE_NAME,IMAGE_TAG,REGISTRY | ||
envs: GITHUB_ACTOR,SECRETS_GITHUB_TOKEN,IMAGE_NAME,IMAGE_SHA,REGISTRY | ||
script: | | ||
echo "$GITHUB_ACTOR $REGISTRY $IMAGE_TAG $IMAGE_NAME $SECRETS_GITHUB_TOKEN IMAGE_SHA" > test.txt | ||
echo "$GITHUB_ACTOR $REGISTRY $IMAGE_SHA $IMAGE_NAME $SECRETS_GITHUB_TOKEN" > test.txt | ||
echo "$SECRETS_GITHUB_TOKEN" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
docker stop $IMAGE_NAME | ||
docker rm $IMAGE_NAME | ||
docker run -d --name $IMAGE_NAME ${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG} | ||
docker run -d --name $IMAGE_NAME ${REGISTRY}/${IMAGE_NAME}:${IMAGE_SHA} |