Skip to content

Commit

Permalink
chore: Update to prepare for github registry push (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
brim-borium authored Apr 3, 2024
1 parent b080803 commit 474ad53
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 63 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/precheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Precheck

on:
pull_request:
branches:
- main
push:
branches:
- main

env:
REGISTRY: ghcr.io
DOCKERHUB_NAMESPACE: slashwhyorganization
DOCKERHUB_REPOSITORY: flutter-sdk-image

jobs:
pull-request:
name: Prebuild docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v4

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_NAMESPACE }}/${{ env.DOCKERHUB_REPOSITORY }}
${{ env.REGISTRY }}/${{ github.repository }}
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}



19 changes: 0 additions & 19 deletions .github/workflows/pull-request.yaml

This file was deleted.

42 changes: 35 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,50 @@
name: Release

env:
IMAGE_TAG: ${{ github.ref_name }}

on:
push:
tags:
- "*"
release:
types: [published]

env:
REGISTRY: ghcr.io
DOCKERHUB_NAMESPACE: slashwhyorganization
DOCKERHUB_REPOSITORY: flutter-sdk-image

jobs:
release:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: make release

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_NAMESPACE }}/${{ env.DOCKERHUB_REPOSITORY }}
${{ env.REGISTRY }}/${{ github.repository }}
- name: Build and push Docker images
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
19 changes: 0 additions & 19 deletions .github/workflows/staging.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions Makefile

This file was deleted.

0 comments on commit 474ad53

Please sign in to comment.