Publish integration #11
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: Publish integration | |
env: | |
FRONTEND_IMAGE_NAME: benchscape-integration-frontend | |
BACKEND_IMAGE_NAME: benchscape-integration-server | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Log in to GitHub container registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "17" | |
distribution: "temurin" | |
cache: 'maven' | |
- name: Build with Maven | |
run: ./mvnw verify -P npm-integration-build | |
- name: Build and push container image for frontend to registry | |
run: | | |
cd frontend | |
docker build . --tag ghcr.io/openelements/${{ env.FRONTEND_IMAGE_NAME }}:latest --tag ghcr.io/openelements/${{ env.FRONTEND_IMAGE_NAME }}:${{ github.sha }} | |
docker push ghcr.io/openelements/${{ env.FRONTEND_IMAGE_NAME }}:latest | |
docker push ghcr.io/openelements/${{ env.FRONTEND_IMAGE_NAME }}:${{ github.sha }} | |
- name: Build and push container image for server to registry | |
run: | | |
cd server | |
docker build . --build-arg STAGE=integration --tag ghcr.io/openelements/${{ env.BACKEND_IMAGE_NAME }}:latest --tag ghcr.io/openelements/${{ env.BACKEND_IMAGE_NAME }}:${{ github.sha }} | |
docker push ghcr.io/openelements/${{ env.BACKEND_IMAGE_NAME }}:latest | |
docker push ghcr.io/openelements/${{ env.BACKEND_IMAGE_NAME }}:${{ github.sha }} | |
- name: Call Portainer webhook for frontend update | |
run: curl -X POST "https://portainer.one.open-elements.com/api/webhooks/a7967e95-1e46-4ce6-8e4e-708a4824930c" | |
- name: Call Portainer webhook for server update | |
run: curl -X POST "https://portainer.one.open-elements.com/api/webhooks/70002123-ac78-4d61-aabe-ea070d523882" |