This commit is contained in:
parent
689a5d76f2
commit
2f6691fab5
2 changed files with 51 additions and 22 deletions
51
.github/workflows/.github-ci.yml
vendored
Normal file
51
.github/workflows/.github-ci.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Repository meta
|
||||||
|
id: repository
|
||||||
|
run: |
|
||||||
|
registry=${{ github.server_url }}
|
||||||
|
registry=${registry##http*://}
|
||||||
|
echo "registry=${registry}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "registry=${registry}"
|
||||||
|
repository="$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')"
|
||||||
|
echo "repository=${repository}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "repository=${repository}"
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
id: docker
|
||||||
|
with:
|
||||||
|
images: ${{ steps.repository.outputs.registry }}/${{ steps.repository.outputs.repository }}
|
||||||
|
-
|
||||||
|
name: Login to registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ steps.repository.outputs.registry }}
|
||||||
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
|
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
buildkitd-flags: '--allow-insecure-entitlement network.host'
|
||||||
|
driver-opts: network=host
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
allow: network.host
|
||||||
|
network: host
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
tags: ${{ steps.docker.outputs.tags }}
|
22
.github/workflows/main.yml
vendored
22
.github/workflows/main.yml
vendored
|
@ -1,22 +0,0 @@
|
||||||
name: Docker Image CI
|
|
||||||
|
|
||||||
on: [push]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Build the Docker image
|
|
||||||
run: docker build . --file Dockerfile --tag hugomd/ascii-live:${GITHUB_SHA:0:8} --tag hugomd/ascii-live:latest
|
|
||||||
- name: Push docker image
|
|
||||||
env:
|
|
||||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
||||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
|
|
||||||
docker push hugomd/ascii-live:${GITHUB_SHA:0:8}
|
|
||||||
docker push hugomd/ascii-live:latest
|
|
Loading…
Reference in a new issue