fix: fixed signup to return 201 status code #48
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
name: Java CI with Gradle | |
on: | |
push: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Copy application.properties and gcp cloud storage key into runner | |
run: | | |
mkdir -p ./src/main/resources | |
touch ./src/main/resources/application.properties | |
echo "${{secrets.APPLICATION_YML}}" > ./src/main/resources/application.properties | |
- name: create-json | |
id: create-json | |
uses: jsdaniell/[email protected] | |
with: | |
name: "googlecloudstoragekey.json" | |
json: ${{ secrets.GCS_JSON_KEY}} | |
dir: 'src/main/resources/' | |
- name: Build with Gradle | |
run: | | |
chmod +x gradlew | |
./gradlew build | |
- name: Docker Login | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ secrets.GHCR_USERNAME }} | |
password: ${{ secrets.GHCR_PASSWORD }} | |
- name: Build Docker | |
run: | | |
docker build -t ghcr.io/${{ secrets.GHCR_USERNAME }}/ssock:latest . | |
- name: Push Docker | |
run: docker push ghcr.io/${{ secrets.GHCR_USERNAME }}/ssock:latest | |
deploy: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Copy docker-compose into instance | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.GCP_HOST }} | |
username: ${{ secrets.GCP_USERNAME }} | |
key: ${{ secrets.GCP_PRIVATEKEY }} | |
source: "./docker-compose.yml,./init-postgis.sh" | |
target: "/home/${{ secrets.GCP_USERNAME }}" | |
overwrite: true | |
debug: true | |
- name: Deploy to Instance | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.GCP_HOST }} | |
username: ${{ secrets.GCP_USERNAME }} | |
key: ${{ secrets.GCP_PRIVATEKEY }} | |
script: | | |
echo ${{ secrets.GHCR_PASSWORD }} | sudo docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin | |
sudo docker pull ghcr.io/${{ secrets.GHCR_USERNAME }}/ssock:latest | |
sudo docker rm -f $(sudo docker ps -qa) || true | |
cd /home/${{ secrets.GCP_USERNAME }} | |
sudo docker-compose up -d | |
sudo docker image prune -f |