Skip to content

Commit

Permalink
Merge pull request #757 from PecanProject/docker-cleanup
Browse files Browse the repository at this point in the history
new docker build
  • Loading branch information
robkooper authored Jul 14, 2024
2 parents 44b09e2 + fd3a682 commit 359ff10
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 80 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,3 @@ jobs:
mkdir -p spec/tmp
bundle exec rails test
bundle exec rspec --tag ~js
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build image
run: docker build --tag image --file Dockerfile .
84 changes: 84 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Docker

on:
push:
branches:
- main
- master
- develop
tags:
- "v*.*.*"
pull_request:

jobs:
docker:
runs-on: ubuntu-latest
permissions:
packages: write

steps:
- uses: actions/checkout@v4

# create metadata for image
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
# list of Docker images to use as base name for tags
images: |
pecan/bety
ghcr.io/${{ github.repository_owner }}/bety
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# setup docker build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Inspect Builder
run: |
echo "Name: ${{ steps.buildx.outputs.name }}"
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
echo "Status: ${{ steps.buildx.outputs.status }}"
echo "Flags: ${{ steps.buildx.outputs.flags }}"
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
# login to registries
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

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

# build the docker images
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
context: .
#push: ${{ github.event_name != 'pull_request' }}
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BETY_GIT_TAGS=${{ steps.meta.outputs.version }}
BETY_GIT_BRANCH=${{ github.ref_name }}
BETY_GIT_CHECKSUM=${{ github.sha }}
BETY_GIT_DATE=${{ github.event.head_commit.timestamp }}
73 changes: 0 additions & 73 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 359ff10

Please sign in to comment.