Skip to content

Commit

Permalink
Merge branch 'main' into alias-content-and-description
Browse files Browse the repository at this point in the history
  • Loading branch information
mwood77 committed Apr 1, 2024
2 parents 11e6c83 + 2785a5c commit 7a08a78
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 41 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: cd

on:
workflow_dispatch:
push:
branches:
- 'main'
release:
types: [published]

jobs:
build_push_to_registry:
name: Build/Push Image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up 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: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/pf2opn
tags: |
type=semver,pattern={{version}}
# dynamically set the branch name as a prefix
type=sha,prefix={{branch}}-
# dynamically set the branch name
type=raw,value={{branch}}-latest
# set the latest branch name
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
52 changes: 11 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,23 @@
name: ci

on:
pull_request:
workflow_dispatch:
push:
branches:
- 'main'
release:
types: [published]


jobs:
build_push_to_registry:
name: Build/Push Image to Docker Hub
build:
runs-on: ubuntu-latest

steps:
- name: Check out the repo
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up 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: Setup Node Environment
uses: actions/setup-node@v4

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/pf2opn
tags: |
type=semver,pattern={{version}}
# dynamically set the branch name as a prefix
type=sha,prefix={{branch}}-
# dynamically set the branch name
type=raw,value={{branch}}-latest
# set the latest branch name
type=raw,value=latest
- name: Install Dependencies
uses: npm ci

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build project
uses: npm run build

0 comments on commit 7a08a78

Please sign in to comment.