Skip to content

Update build action #10

Update build action

Update build action #10

Workflow file for this run

name: Build and Push Containers
on:
push:
branches:
- main
# paths:
# - '*/Dockerfile'
# - '*/VERSION'
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
container:
- stn-deploy-2024.1
- stn-deploy-master
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Read VERSION file
id: version
run: echo "version=$(cat ${{ matrix.container }}/VERSION)" >> $GITHUB_ENV
- name: Build and push Docker image with version
uses: docker/build-push-action@v6
with:
context: ${{ matrix.container }}
file: ${{ matrix.container }}/Dockerfile
push: true
tags: |
ghcr.io/stackers-network/${{ matrix.container }}:${{ env.version }}
ghcr.io/stackers-network/${{ matrix.container }}:latest