-
Notifications
You must be signed in to change notification settings - Fork 25
38 lines (35 loc) · 1005 Bytes
/
image-builder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Build and publish the container image
on:
push:
branches:
- main
workflow_dispatch:
env:
IMAGE_NAME: ansible-community/ansible-website
TAGS: latest
REGISTRY: ghcr.io
REGISTRY_USER: ${{ github.actor }}
jobs:
build_dockerfile:
runs-on: ubuntu-20.04
name: Build and publish the image
steps:
- name: Check out the website repository
uses: actions/checkout@v4
- name: Buildah build the website image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.TAGS }}
containerfiles: |
./Dockerfile
- name: Push the website image to ghcr.io
id: push_image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ secrets.GITHUB_TOKEN }}