Skip to content

feat: add github action #1

feat: add github action

feat: add github action #1

Workflow file for this run

name: Release
on:
release:
types: [prereleased]
push:
branches:
- main
- v*
- dev*
paths:
- "Containerfile"
- ".github/workflows/release.yml"
jobs:
build-ghcr:
name: Build And Push to ghcr.io
runs-on: ubuntu-latest
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
IMAGE_REGISTRY: ghcr.io
ORG_NAME: idevsig
IMAGE: cfspeedtest
TAG: latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to ghcr.io
uses: docker/login-action@v2
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.ORG_NAME }}/${{ env.IMAGE }}:${{ env.TAG }}
build-docker:
name: Build And Push Docker Hub
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
IMAGE: cfspeedtest
TAG: latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./Containerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.DOCKERHUB_USERNAME }}/${{ env.IMAGE }}:${{ env.TAG }}