Skip to content

Merge pull request #31 from t1nyb0x/develop #6

Merge pull request #31 from t1nyb0x/develop

Merge pull request #31 from t1nyb0x/develop #6

Workflow file for this run

name: release
on:
push:
branches:
- main
release:
types: [published]
env:
DOCKER_BASE_NAME: ghcr.io/${{ github.repository }}
jobs:
hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
push-image:
runs-on: ubuntu-latest
needs: hadolint
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Set Env
run: |
if [ "${{ github.event_name }}" = 'release' ]; then
export TAG_NAME="${{ github.event.release.tag_name }}"
else
export TAG_NAME="latest"
fi
echo "PKG_TAG"=${DOCKER_BASE_NAME}:${TAG_NAME} >> ${GITHUB_ENV}
- name: Build Image
run: |
docker build . -t "${PKG_TAG}"
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image
run: |
docker push "${PKG_TAG}"