This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
Deleted install script and optimized Dockerfile #135
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: Push | ||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: 'adopt' | ||
- name: Tests | ||
run: mvn test | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- tests | ||
Check failure on line 28 in .github/workflows/push.yml GitHub Actions / PushInvalid workflow file
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: 'adopt' | ||
- name: Build | ||
run: mvn -B package -DskipTests | ||
docker: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: registry.ziedelth.fr:5000 | ||
username: ziedelth | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
- name: Build and push snapshot | ||
uses: docker/build-push-action@v5 | ||
if: github.ref == 'refs/heads/master' | ||
with: | ||
context: . | ||
push: true | ||
tags: registry.ziedelth.fr:5000/jais-scraper:snapshot | ||
- name: Build and push production | ||
uses: docker/build-push-action@v5 | ||
if: github.ref == 'refs/heads/stable' | ||
with: | ||
context: . | ||
push: true | ||
tags: registry.ziedelth.fr:5000/jais-scraper:latest | ||
release: | ||
if: github.ref == 'refs/heads/stable' | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- name: Install SSH KEY | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
known_hosts: 'just-a-placeholder-so-we-dont-get-errors' | ||
- name: Adding Known Hosts | ||
run: ssh-keyscan -p 2222 -H ${{ secrets.SSH_HOST_IP }} >> ~/.ssh/known_hosts | ||
- name: SSH Commands | ||
run: | | ||
ssh -C -p 2222 ${{ secrets.SSH_DESTINATION }} "docker pull localhost:5000/jais-scraper:latest && cd ${{ secrets.SSH_FOLDER }} && docker compose down jais-scraper && docker compose up jais-scraper -d" |