|
| 1 | +# ********************************************************************************************************************** # |
| 2 | +# # |
| 3 | +# ::: ::: ::: ::: ::: ::: ::::::::::: :::::::::: # |
| 4 | +# containerdisk-fedora39.yml :+: :+: :+: :+: :+: :+: :+: :+: :+: # |
| 5 | +# +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+ # |
| 6 | +# By: codespace <[email protected]> +#++:++ +#++:++#++: +#+ +#++: +#+ +#++:++# # |
| 7 | +# +#+ +#+ +#+ +#+ +#+ +#+ +#+ +#+ # |
| 8 | +# Created: 2023/12/17 16:36:26 by codespace #+# #+# #+# #+# #+# #+# #+# #+# # |
| 9 | +# Updated: 2023/12/17 16:37:32 by codespace ### ### ### ### ########## ### ### ##########.ro # |
| 10 | +# # |
| 11 | +# ********************************************************************************************************************** # |
| 12 | + |
| 13 | +name: Container Image CI |
| 14 | + |
| 15 | +on: |
| 16 | + push: |
| 17 | + branches: [ "main" ] |
| 18 | + pull_request: |
| 19 | + branches: [ "main" ] |
| 20 | + release: |
| 21 | + types: [published] |
| 22 | + schedule: |
| 23 | + - cron: "0 0 * * *" |
| 24 | + |
| 25 | +env: |
| 26 | + REGISTRY: ghcr.io |
| 27 | + IMAGE_NAME: ${{ github.repository }} |
| 28 | + |
| 29 | +jobs: |
| 30 | + build-and-push-image: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + permissions: |
| 33 | + contents: read |
| 34 | + packages: write |
| 35 | + |
| 36 | + steps: |
| 37 | + - name: Checkout repository |
| 38 | + uses: actions/checkout@v3 |
| 39 | + |
| 40 | + - name: Login to Github Container Registory |
| 41 | + uses: docker/login-action@v2 |
| 42 | + with: |
| 43 | + registry: ${{ env.REGISTRY }} |
| 44 | + username: ${{ github.actor }} |
| 45 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + |
| 47 | + - name: Extract metadata (tags, labels) for Container |
| 48 | + id: meta |
| 49 | + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 |
| 50 | + with: |
| 51 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 52 | + |
| 53 | + - name: Build and Push Container Images |
| 54 | + uses: docker/build-push-action@v4 |
| 55 | + with: |
| 56 | + context: . |
| 57 | + file: ./fedora39.Dockerfile |
| 58 | + push: true |
| 59 | + tags: ghcr.io/docheio/containerdisk-fedora:38 |
| 60 | + labels: ${{ steps.meta.outputs.labels }} |
0 commit comments