combined workflows #2
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 Docker image to GitHub Packages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-push: | |
name: Build Docker image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 | |
- name: Run mapping generator | |
run: cd mappinggenerator && go run main.go | |
- name: Build config generator | |
run: go build -o docker-build/ocbconfigbuilder src/*.go | |
- name: Build Docker image | |
run: docker build -f docker-build/Dockerfile --tag ghcr.io/${{ github.repository }}:latest docker-build/ | |
- name: Log in to GitHub Docker Registry | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: ghcr.io/${{ github.repository }}:latest |