Skip to content

Commit dedcac4

Browse files
Revert "Temporarily remove OCI workflow files entirely"
This reverts commit 0ab9fbb.
1 parent 8d990e2 commit dedcac4

File tree

2 files changed

+180
-0
lines changed

2 files changed

+180
-0
lines changed

.github/workflows/oci-base.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# https://github.com/marketplace/actions/build-and-push-docker-images
2+
name: OCI Base Image
3+
on:
4+
schedule:
5+
- cron: '0 3 * * *'
6+
workflow_dispatch:
7+
jobs:
8+
build-publish:
9+
runs-on: ubuntu-20.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Set up QEMU
15+
id: qemu
16+
uses: docker/setup-qemu-action@v2
17+
with:
18+
image: tonistiigi/binfmt:latest
19+
platforms: linux/amd64,linux/arm64
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v1
23+
24+
- name: Available platforms
25+
run: echo ${{ steps.buildx.outputs.platforms }}
26+
27+
- name: Cache Docker layers
28+
uses: actions/[email protected]
29+
with:
30+
path: /tmp/.buildx-cache
31+
key: ${{ runner.os }}-${{ matrix.image_tag_suffix }}-buildx-${{ github.event.pull_request.head.sha || github.sha }}
32+
restore-keys: |
33+
${{ runner.os }}-${{ matrix.image_tag_suffix }}-buildx-
34+
35+
- name: Check for Push Credentials
36+
id: authorized
37+
run: |
38+
if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]; then
39+
echo "PUSH=true" >> $GITHUB_OUTPUT
40+
else
41+
echo "PUSH=false" >> $GITHUB_OUTPUT
42+
fi
43+
44+
- name: Login to DockerHub
45+
if: steps.authorized.outputs.PUSH == 'true'
46+
uses: docker/login-action@v1
47+
with:
48+
username: ${{ secrets.DOCKERHUB_USERNAME }}
49+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
50+
51+
# - name: Build and push
52+
# uses: docker/build-push-action@v4
53+
# with:
54+
# context: packaging/base-image
55+
# platforms: linux/amd64,linux/arm64
56+
# pull: true
57+
# push: ${{ steps.authorized.outputs.PUSH }}
58+
# tags: |
59+
# pivotalrabbitmq/ubuntu:20.04
60+
# cache-from: type=local,src=/tmp/.buildx-cache
61+
# cache-to: type=local,dest=/tmp/.buildx-cache-new
62+
63+
# Temp fix
64+
# https://github.com/docker/build-push-action/issues/252
65+
# https://github.com/moby/buildkit/issues/1896
66+
- name: Move cache
67+
run: |
68+
rm -rf /tmp/.buildx-cache
69+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/oci.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# # https://github.com/marketplace/actions/build-and-push-docker-images
2+
# name: OCI
3+
# on:
4+
# push:
5+
# paths-ignore:
6+
# - '.github/workflows/secondary-umbrella.yaml'
7+
# - '.github/workflows/update-elixir-patches.yaml'
8+
# - '.github/workflows/update-otp-patches.yaml'
9+
# workflow_dispatch:
10+
# env:
11+
# VERSION: ${{ github.event.pull_request.head.sha || github.sha }}
12+
# concurrency:
13+
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
# cancel-in-progress: true
15+
# jobs:
16+
# build-publish-dev-bazel:
17+
# runs-on: ubuntu-latest
18+
# steps:
19+
# - name: Checkout
20+
# uses: actions/checkout@v3
21+
22+
# - name: Set up QEMU
23+
# uses: docker/setup-qemu-action@v3
24+
25+
# - name: Set up Docker Buildx
26+
# uses: docker/setup-buildx-action@v3
27+
28+
# - name: Configure Erlang
29+
# uses: erlef/setup-beam@v1
30+
# with:
31+
# otp-version: 26.2
32+
# elixir-version: 1.15
33+
34+
# - name: Expose GitHub Runtime
35+
# uses: crazy-max/ghaction-github-runtime@v3
36+
37+
# - name: Configure Bazel
38+
# run: |
39+
# if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then
40+
# cat << EOF >> user.bazelrc
41+
# build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }}
42+
# EOF
43+
# fi
44+
# cat << EOF >> user.bazelrc
45+
# build:buildbuddy --build_metadata=ROLE=CI
46+
# build:buildbuddy --build_metadata=VISIBILITY=PRIVATE
47+
# build:buildbuddy --color=yes
48+
49+
# build --experimental_ui_max_stdouterr_bytes=4194304
50+
# build --action_env EXTRA_BUILDX_OPTS="--cache-from=type=gha --cache-to=type=gha"
51+
# EOF
52+
53+
# # - name: Build amd64
54+
# # run: |
55+
# # bazelisk build //packaging/docker-image:rabbitmq-amd64 \
56+
# # --config=buildbuddy
57+
58+
# # - name: Build arm64
59+
# # run: |
60+
# # bazelisk build //packaging/docker-image:rabbitmq-arm64 \
61+
# # --config=buildbuddy
62+
63+
# # - name: Test
64+
# # run: |
65+
# # OCI_TESTS=$(bazel cquery 'tests(//packaging/docker-image/...)' | awk '{ print $1 }')
66+
# # bazelisk test ${OCI_TESTS} \
67+
# # --config=buildbuddy
68+
69+
# - name: Check for Push Credentials
70+
# id: authorized
71+
# run: |
72+
# if [ -n "${{ secrets.DOCKERHUB_USERNAME }}" ]; then
73+
# echo "PUSH=true" >> $GITHUB_OUTPUT
74+
# else
75+
# echo "PUSH=false" >> $GITHUB_OUTPUT
76+
# fi
77+
78+
# - name: Assemble Multi-Arch
79+
# run: |
80+
# bazelisk build //packaging/docker-image:rabbitmq \
81+
# --config=buildbuddy
82+
83+
# - name: Login to DockerHub
84+
# if: steps.authorized.outputs.PUSH == 'true'
85+
# uses: docker/login-action@v1
86+
# with:
87+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
88+
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
89+
90+
# - name: Tag and Push
91+
# if: steps.authorized.outputs.PUSH == 'true'
92+
# run: |
93+
# TAG_1="${{ env.VERSION }}"
94+
95+
# REF_NAME="${{ github.ref_name }}"
96+
# TAG_2="${REF_NAME//\//-}"
97+
98+
# set -x
99+
# bazelisk run //packaging/docker-image:push \
100+
# --config=buildbuddy -- \
101+
# --tag ${TAG_1} \
102+
# --tag ${TAG_2}
103+
104+
# summary-oci:
105+
# needs:
106+
# - build-publish-dev-bazel
107+
# runs-on: ubuntu-latest
108+
# steps:
109+
# - name: SUMMARY
110+
# run: |
111+
# echo "SUCCESS"

0 commit comments

Comments
 (0)