Skip to content

first commit

first commit #1

name: Build and Push Docker Image
on:
push:
branches:
- develop
jobs:
build-and-push-image:
runs-on: ubuntu-22.04
environment: rndsillog-github
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
zarathucorp/indulgentia-github
- name: Set TAG env
run: echo "RELEASE_VERSION=v$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Metadata
run: echo "container tag will be 'latest' and '${{ env.RELEASE_VERSION }}'"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Set env before build
run: |
touch .env
echo "APP_ID=${{ secrets.APP_ID }}" >> .env
echo "PORT=${{ secrets.PORT }}" >> .env
echo "HOST=${{ secrets.HOST }}" >> .env
echo "PRIVATE_KEY=${{ secrets.PRIVATE_KEY }}" >> .env
echo "WEBHOOK_SECRET=${{ secrets.WEBHOOK_SECRET }}" >> .env
echo "GITHUB_CLIENT_ID=${{ secrets.PROBOT_GITHUB_CLIENT_ID }}" >> .env
echo "GITHUB_CLIENT_SECRET=${{ secrets.PROBOT_GITHUB_CLIENT_SECRET }}" >> .env
echo "CONNECTION_STRING=${{ secrets.CONNECTION_STRING }}" >> .env
echo "CONTAINER_NAME=${{ secrets.CONTAINER_NAME }}" >> .env
echo "SUPABASE_URL=${{ secrets.SUPABASE_URL }}" >> .env
echo "SUPABASE_KEY=${{ secrets.SUPABASE_KEY }}" >> .env
echo "API_SERVER_URL=${{ secrets.API_SERVER_URL }}" >> .env
ls -a
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/indulgentia-github:latest
ghcr.io/${{ github.repository_owner }}/indulgentia-github:${{ env.RELEASE_VERSION }}
- name: Trigger rndsillog-network repo action
run: |
curl -X POST -H "Authorization: token ${{ secrets.GHCR_TOKEN }}" \
-d '{"event_type": "trigger"}' \
https://api.github.com/repos/zarathucorp/rndsillog-network/dispatches