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 | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ghcr.io/akdasa-studios/lectorium-gateway | |
IMAGE_TAG: ${{ github.sha }} | |
jobs: | |
build-gateway: | |
name: Build Gateway | |
runs-on: ubuntu-latest | |
environment: Staging | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./modules/services/gateway | |
push: true | |
tags: | | |
ghcr.io/akdasa-studios/lectorium-gateway:${{ env.IMAGE_TAG }} | |
ghcr.io/akdasa-studios/lectorium-gateway:staging | |
deploy-gateway: | |
name: Deploy Gateway | |
runs-on: ubuntu-latest | |
environment: Production | |
needs: build-gateway | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Promote Docker Images | |
uses: EuphoricSystems/docker-promote-image@v2 | |
with: | |
src: ghcr.io/akdasa-studios/lectorium-gateway | |
destinations: | | |
ghcr.io/akdasa-studios/lectorium-gateway:latest |