Skip to content

docker

docker #23

Workflow file for this run

name: docker
on:
workflow_dispatch:
jobs:
publish-dockerhub:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Fork from https://github.com/koishijs/boilerplate/blob/master/.github/workflows/docker.yml
- name: Run buildx and push
env:
DOCKER_REPO: lxduo/matrix-qq
GITHUB_REPO: duo/matrix-qq
run: |
TAG=$(curl "https://api.github.com/repos/duo/matrix-qq/git/refs/tags" | jq -r '.[-1].ref' | sed 's|refs/tags/||')
docker buildx build \
--output "type=image,push=true" \
--platform linux/amd64,linux/arm64 \
--tag ${DOCKER_REPO}:$TAG \
--tag ${DOCKER_REPO}:latest \
--file ./Dockerfile \
.
- name: Docker Hub logout
if: always()
run: docker logout