-
Notifications
You must be signed in to change notification settings - Fork 1
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
oussama Dahmaz
authored and
oussama Dahmaz
committed
Aug 23, 2024
1 parent
f3faf0b
commit 4922278
Showing
1 changed file
with
56 additions
and
12 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 |
---|---|---|
@@ -1,21 +1,65 @@ | ||
name: Docker Image RaspberryPI | ||
|
||
on: push | ||
on: | ||
push: | ||
branches: | ||
- "**" | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
rpi: | ||
name : Generate for RaspberryPI | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build and push Docker images | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.CONTAINER_GH_LOGIN }} | ||
password: ${{ secrets.CONTAINER_GH_TOKEN }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
ghcr.io/yadoms/build_for_raspberrypi | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=ref,event=tag | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
- 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: Login to GitHub Container Registry | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
repository: yadoms/build_for_raspberrypi | ||
tag_with_ref: true | ||
path: build-raspberrypi | ||
|
||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: "{{defaultContext}}:build-raspberrypi" | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |