Docker #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * 1" | |
push: | |
branches: | |
- latest | |
- main | |
paths-ignore: | |
- 'README.MD' | |
- '.github' | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# - name: Log in to the Container registry | |
# uses: docker/login-action@v3 | |
# with: | |
# registry: ghcr.io | |
# username: ${{ github.actor }} | |
# password: ${{ secrets.GIT_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: dockerfile.amd64 | |
platforms: linux/amd64 | |
push: true | |
tags: ${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_amd64 | |
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_amd64,mode=max | |
# - name: Build and push Docker images | |
# uses: docker/build-push-action@v5 | |
#with: | |
#context: . | |
#file: dockerfile.arm64 | |
#platforms: linux/arm64 | |
#push: true | |
#tags: ${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:arm64 | |
#labels: ${{ steps.meta.outputs.labels }} | |
#cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_arm64 | |
#cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_arm64,mode=max |