generated from dreampipcom/nexus
-
-
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
56d00e6
commit d551552
Showing
1 changed file
with
38 additions
and
38 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 |
---|---|---|
|
@@ -126,42 +126,42 @@ jobs: | |
# # --set-secrets= | ||
|
||
|
||
deploy-to-gcp-vm: | ||
needs: build-and-push-image | ||
name: hypnos::deploy_prod::push_to_gcp::vm | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: hypnos::deploy_prod::gcp::Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: hypnos::deploy_prod::gcp::Set Docker image tag | ||
id: set_tag | ||
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
|
||
- name: hypnos::deploy_prod::gcp::Set up Google Cloud SDK | ||
uses: google-github-actions/[email protected] | ||
with: | ||
service_account_email: ${{ secrets.GCP_SA_EMAIL }} | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
export_default_credentials: true | ||
project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
# deploy-to-gcp-vm: | ||
# needs: build-and-push-image | ||
# name: hypnos::deploy_prod::push_to_gcp::vm | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: hypnos::deploy_prod::gcp::Checkout repository | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: hypnos::deploy_prod::gcp::Set Docker image tag | ||
# id: set_tag | ||
# run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" | ||
|
||
# - name: hypnos::deploy_prod::gcp::Set up Google Cloud SDK | ||
# uses: google-github-actions/[email protected] | ||
# with: | ||
# service_account_email: ${{ secrets.GCP_SA_EMAIL }} | ||
# service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
# export_default_credentials: true | ||
# project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
|
||
- name: hypnos::deploy_prod::gcp::Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: install ssh keys | ||
# check this thread to understand why its needed: | ||
# <https://stackoverflow.com/a/70447517> | ||
run: | | ||
install -m 600 -D /dev/null ~/.ssh/id_rsa | ||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | ||
ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts | ||
- name: connect and pull | ||
run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && docker compose pull && docker compose up -d && exit" | ||
- name: cleanup | ||
run: rm -rf ~/.ssh | ||
# - name: hypnos::deploy_prod::gcp::Log in to the Container registry | ||
# uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
# with: | ||
# registry: ${{ env.REGISTRY }} | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - name: install ssh keys | ||
# # check this thread to understand why its needed: | ||
# # <https://stackoverflow.com/a/70447517> | ||
# run: | | ||
# install -m 600 -D /dev/null ~/.ssh/id_rsa | ||
# echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | ||
# ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts | ||
# - name: connect and pull | ||
# run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && docker compose pull && docker compose up -d && exit" | ||
# - name: cleanup | ||
# run: rm -rf ~/.ssh |