Fix: change list to string in docker push tags. #8
Workflow file for this run
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
on: | |
push: | |
branches: | |
- main | |
- cicd/deploy # TODO: remove after testing | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Setup Java JDK | |
uses: actions/[email protected] | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- | |
run: ./gradlew clean bootJar -x test | |
- | |
name: Log in to the Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{env.REGISTRY}} | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- | |
name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: true | |
tags: | | |
ghcr.io/wafflestudio/csereal-server/server_image:latest | |
ghcr.io/wafflestudio/csereal-server/server_image:${{github.sha}} | |
- | |
name: SCP Command to Transfer Files | |
uses: appleboy/[email protected] | |
with: | |
host: ${{secrets.SSH_HOST}} | |
username: ${{secrets.SSH_USER}} | |
key: ${{secrets.SSH_KEY}} | |
source: "docker-compose.yml" | |
target: "~/app" | |
overwrite: true | |
- | |
name: SSH Remote Commands | |
uses: appleboy/[email protected] | |
with: | |
host: ${{secrets.SSH_HOST}} | |
username: ${{secrets.SSH_USER}} | |
key: ${{secrets.SSH_KEY}} | |
script: | | |
cd ~/app | |
export MYSQL_ROOT_PASSWORD=${{secrets.MYSQL_ROOT_PASSWORD}} | |
export MYSQL_USER=${{secrets.MYSQL_USER}} | |
export MYSQL_PASSWORD=${{secrets.MYSQL_PASSWORD}} | |
export MYSQL_DATABASE=${{secrets.MYSQL_DATABASE}} | |
export MYSQL_ROOT_PASSWORD=${{secrets.MYSQL_ROOT_PASSWORD}} | |
docker-compose down | |
docker-compose pull | |
docker-compose up -d |