Skip to content

Commit

Permalink
Update build-develop.yml
Browse files Browse the repository at this point in the history
Added ARM support and Docker Hub support.
  • Loading branch information
InsertDisc authored Jan 9, 2024
1 parent cd317ec commit cf498a5
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions .github/workflows/build-develop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Build :develop

on:
workflow_dispatch:
push:
Expand All @@ -13,20 +14,53 @@ on:
types: [closed]

jobs:
build:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: develop
ref: main

- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build Docker image
run: docker build -t ghcr.io/insertdisc/pattrmm:develop .
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: Build and push to GitHub Container Registry
id: docker_build_push_ghcr
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ghcr.io/insertdisc/pattrmm:develop
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Pull image from GitHub Container Registry
run: docker pull ghcr.io/insertdisc/pattrmm:develop

- name: Tag for Docker Hub
run: |
docker tag ghcr.io/insertdisc/pattrmm:develop ${{ secrets.DOCKER_HUB_USERNAME }}/pattrmm:develop
- name: Push Docker image
run: docker push ghcr.io/insertdisc/pattrmm:develop
- name: Push to Docker Hub
run: |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/pattrmm:develop

0 comments on commit cf498a5

Please sign in to comment.