Skip to content

feat: fist release version #1

feat: fist release version

feat: fist release version #1

Workflow file for this run

name: Release image to GHCR
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-tags: True
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.12"
- name: Install dependencies
run: |
$(cat Dockerfile | grep "pip install" | cut -f2- -d " ")
- name: Install pylint
run: |
python -m pip install pylint==3.0.3
- name: Lint Python code
run: |
pylint --disable=R,C,W1203 bot/main.py
- name: Lint Dockerfile with hadolint
uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
failure-threshold: error
ignore: DL3008,SC3009,DL3013
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: minor
- name: Login to GitHub Container Registry
# do this step only on push to main and do not run for pull request
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image and push to registry
uses: docker/build-push-action@v5
with:
context: .
# push to registry when merge to main
push: ${{ github.ref == 'refs/heads/main' }}
no-cache: true
tags: |
ghcr.io/yurnov/explosion-notifier:master
ghcr.io/yurnov/explosion-notifier:${{ steps.tag_version.outputs.new_tag }}