Skip to content

cd git actions 작성 #27

cd git actions 작성

cd git actions 작성 #27

Workflow file for this run

name: Dev deploy
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with gradle
run : ./gradlew clean build -x test
- name: Build Docker image
run: |

Check failure on line 42 in .github/workflows/deploy-dev.yml

View workflow run for this annotation

GitHub Actions / Dev deploy

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-dev.yml (Line: 42, Col: 14): Unrecognized named-value: 'DATASOURCE_URL'. Located at position 1 within expression: DATASOURCE_URL
docker login -u ${{ secrets.DOCKERHUB_ID }} -p ${{ secrets.DOCKERHUB_PASSWORD }}
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2 \
--build-arg DATASOURCE_URL=${{ DATASOURCE_URL }} \
--build-arg DATASOURCE_USERNAME=${{ DATASOURCE_USERNAME }} \
--build-arg DATASOURCE_PASSWORD=${{ JWT_SECRET }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2
- name: Docker Deploy executing remote ssh commands using ssh_key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.WAS_HOST }}
username: ${{ secrets.WAS_USERNAME }}
key: ${{ secrets.WAS_KEY }}
script : |
cd ~/mju-graduate-server
docker stop $(docker ps -a -q)
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/mju-graduate-server:v2
docker rm -f $(docker ps -a -q)
docker run -d --name mju-graduate-api-server -p 8080:8080 ${{ secrets.DOCKER_USERNAME }}/mju-graduate-server:v2