Switch from Debian to Alpine #15
This file contains hidden or 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: build | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v6 | |
id: docker_build | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ github.repository }}:develop, | |
ghcr.io/${{ github.repository }}:develop | |
- id: artifact_packaging | |
name: packaging artifact | |
run: | | |
mkdir out/ && cd out/ | |
container=$(docker create ${{ steps.docker_build.outputs.imageid }}) | |
docker cp $container:/app/nginx-syslog-postgres-bridge . | |
echo "version=$(./nginx-syslog-postgres-bridge --version | awk -F ' ' '{print $2}')" >> $GITHUB_OUTPUT | |
tar -cvf nginx-syslog-postgres-bridge.tar nginx-syslog-postgres-bridge | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: nginx-syslog-postgres-bridge-${{ steps.artifact_packaging.outputs.version }}-linux-amd64.tar | |
path: ./out/nginx-syslog-postgres-bridge.tar |