Merge pull request #18 from terrateamio/pro-368-fix-build-redux #16
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: code-indexer-build-production | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Flyctl and authenticate | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
run: | | |
curl -L https://fly.io/install.sh | sh | |
/home/runner/.fly/bin/flyctl auth docker | |
- name: Pull base image from Fly.io | |
run: docker pull registry.fly.io/terrateam-app-production:base | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: docker/terrat/Dockerfile.code_indexer | |
build-args: | | |
BASE_IMAGE=registry.fly.io/terrateam-app-production:base | |
push: true | |
tags: ghcr.io/terrateamio/terrat-code-indexer:latest |