Skip to content

docker build workflow #3

docker build workflow

docker build workflow #3

Workflow file for this run

name: 2. Binary Artifact Build
on:
pull_request:
types: [ closed ]
branches: [ main ]
jobs:
load_env:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Load environment variables
id: dotenv
run: |
if [ -f .env ]; then
export $(cat .env | xargs)
fi
echo "NAME=${NAME}" >> $GITHUB_OUTPUT
echo "TAGS=${TAGS}" >> $GITHUB_OUTPUT
outputs:
NAME: ${{ steps.dotenv.outputs.NAME }}
TAGS: ${{ steps.dotenv.outputs.TAGS }}
test:
needs: load_env
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.1'
build_exe:
needs: [ load_env, test ]
if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23.1'
- name: Run build script
run: ./build.sh ${{ needs.load_env.outputs.NAME }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ needs.load_env.outputs.NAME }}
path: ${{ needs.load_env.outputs.NAME }}