Skip to content
This repository has been archived by the owner on Feb 10, 2024. It is now read-only.

File Creator Dockerfile and .yml for CI/CD #42

Merged
merged 2 commits into from
Jun 21, 2023

Conversation

Mik-TF
Copy link
Contributor

@Mik-TF Mik-TF commented Jun 18, 2023

This is a PR to incorporate the Dockerfile and .yml file for the file_creator.v program.

The publish.yml should be updated to take into account the other Dockerfile in the repository (for file_creator.v).

I propose to use a matrix in publish.yml.

I am not sure of the final version of the publish.yml with the matrix, so I will post it here (next comment) and we can discuss how to improve it, if needed.
Note that this is a draft PR as it is not yet ready for merge.

@brandonpille
If you can have a look, it would be great! Thanks.

@Mik-TF
Copy link
Contributor Author

Mik-TF commented Jun 18, 2023

publish.yml could be edited with the following matrix strategy. It might need some improvements.

name: Publish 

on:
  release:
    types: [published]

jobs:
  build-and-push:
    runs-on: ubuntu-22.04
    strategy:
      matrix:
        include:
          - dockerfile: ./Dockerfile
            image: ghcr.io/${{ github.repository }}/farmerbot_image
          - dockerfile: ./file_creator/Dockerfile
            image: ghcr.io/${{ github.repository }}/file_creator_image
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout the repo
        uses: actions/checkout@v3

      - name: Log in to the Container registry
        uses: docker/login-action@v2.1.0
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}

      - name: Extract metadata for Docker
        id: meta
        uses: docker/metadata-action@v4
        with:
          images: ${{ matrix.image }}
          tags: |
            type=semver,pattern={{version}}

      - name: Build and push Docker image
        uses: docker/build-push-action@v4
        with:
          push: true
          context: .
          file: ${{ matrix.dockerfile }}
          tags: ${{ steps.meta.outputs.tags }}
          labels: ${{ steps.meta.outputs.labels }}

@brandonpille
Copy link
Contributor

Oh that's a great idea! You can go ahead and do the implementation in this PR.

Copy link
Contributor

@brandonpille brandonpille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@brandonpille brandonpille marked this pull request as ready for review June 20, 2023 13:11
@brandonpille brandonpille merged commit 2d036f7 into development Jun 21, 2023
1 check passed
@brandonpille brandonpille deleted the file_creator_ci branch June 21, 2023 09:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants