-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e170c0
commit 390d1ba
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: "Build container image" | ||
|
||
env: | ||
NAME: "vdi-api-openstack" | ||
REGISTRY: ghcr.io/alexthegeek | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Authorise : | ||
# - Accès en lecture seule au contenu du dépôt Git | ||
# - Accès en lecture/écriture au "packages" pour avoir l'accès au registre de | ||
# conteneurs de GitHub | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
build-push-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Récupération du dépôt Git | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
# Construction de l'image de conteneur avec buildah | ||
- name: Build container image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: ${{ env.NAME }} | ||
context: Docker/API | ||
tags: latest | ||
containerfiles: Dockerfile | ||
layers: false | ||
oci: true | ||
|
||
# Publication de l'image de conteneur dans le regsitre de GitHub avec podman | ||
- name: Push to Container Registry | ||
uses: redhat-actions/push-to-registry@v2 | ||
id: push | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
image: ${{ env.NAME }} | ||
tags: latest | ||
|
||
# Authentification au registre de conteneur de GitHub | ||
- name: Login to Container Registry | ||
uses: redhat-actions/podman-login@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} |