Skip to content

Commit

Permalink
Create docker-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
zmisgod authored Jul 17, 2024
1 parent 1743e87 commit d879160
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/docker-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Create and publish a Docker image to Github Packages

on:
push:
tags:
- "v*"

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- name: Setup Environments
id: envs
run: |
IPTVCHECKER_LATEST_TAG=$(git describe --tags --abbrev=0)
DOCKER_IMAGE=${{ github.repository }}

echo "RELEASE_VERSION=${GITHUB_REF#refs}"
TAGS="${DOCKER_IMAGE}:latest,${DOCKER_IMAGE}:${IPTVCHECKER_LATEST_TAG}"

echo "IPTVCHECKER_LATEST_TAG:${IPTVCHECKER_LATEST_TAG}"
echo ::set-output name=tags::${TAGS}
mkdir iptv-checker && cp dockerfile iptv-checker/dockerfile
git clone https://github.com/zhimin-dev/iptv-checker-rs.git
git clone https://github.com/zhimin-dev/iptv-checker-web.git
- name: Setup Docker Buildx Command
id: buildx
uses: docker/setup-buildx-action@master

- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build Docker Image and Push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
builder: ${{ steps.buildx.outputs.name }}
context: .
file: iptv-checker/dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.envs.outputs.tags }}

- name: Update Docker Hub Description
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ github.repository }}
short-description: ${{ github.event.repository.description }}

- name: Image Digest
run: echo ${{ steps.docker_build.outputs.digest }}

0 comments on commit d879160

Please sign in to comment.