From 95b07a8ee6cb750fd9d95fc064c32f63df126b20 Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Thu, 15 Feb 2024 11:13:16 +0100 Subject: [PATCH] add docker image package workflow --- .github/workflows/update-docker-image.yml | 47 +++++++++++++++++++ arc-validate-package-registry.sln | 5 ++ .../Data/arc-validate-package-index.json | 8 ++-- 3 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/update-docker-image.yml diff --git a/.github/workflows/update-docker-image.yml b/.github/workflows/update-docker-image.yml new file mode 100644 index 0000000..e61de32 --- /dev/null +++ b/.github/workflows/update-docker-image.yml @@ -0,0 +1,47 @@ +name: "update docker image" + +on: + push: + branches: ['main'] + paths: + - 'src/**' + - '!src/Data/**' + - '!src/StagingArea/**' + +env: + REGISTRY: ghcr.io + IMAGE_NAME: avpr + +jobs: + build-and-push-image: + #only publish docker images when tests succeed + #needs: [build-and-test-linux, build-and-test-windows] + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5.5.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5.1.0 + with: + context: ./src/PackageRegistryService/ + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/arc-validate-package-registry.sln b/arc-validate-package-registry.sln index 72175a5..af78bf8 100644 --- a/arc-validate-package-registry.sln +++ b/arc-validate-package-registry.sln @@ -33,6 +33,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "index-workflow", "index-wor update-index.fsx = update-index.fsx EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{24F7CF58-94B9-4FB4-8A59-FD329B3C431D}" + ProjectSection(SolutionItems) = preProject + .github\workflows\update-docker-image.yml = .github\workflows\update-docker-image.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/src/PackageRegistryService/Data/arc-validate-package-index.json b/src/PackageRegistryService/Data/arc-validate-package-index.json index 8752777..90df206 100644 --- a/src/PackageRegistryService/Data/arc-validate-package-index.json +++ b/src/PackageRegistryService/Data/arc-validate-package-index.json @@ -2,7 +2,7 @@ { "RepoPath": "src/PackageRegistryService/StagingArea/invenio/invenio@1.0.0.fsx", "FileName": "invenio@1.0.0.fsx", - "LastUpdated": "2024-02-12T13:12:45+01:00", + "LastUpdated": "2024-02-12T13:12:41+01:00", "Metadata": { "Name": "invenio", "Description": "Validates if the ARC contains the necessary metadata to be publishable via Invenio.\nThe following metadata is required:\n - Investigation has title and description\n - All persons in Investigation Contacts must have a name, last name, affiliation and valid email\n", @@ -18,7 +18,7 @@ { "RepoPath": "src/PackageRegistryService/StagingArea/test/test@1.0.0.fsx", "FileName": "test@1.0.0.fsx", - "LastUpdated": "2024-02-12T13:12:45+01:00", + "LastUpdated": "2024-02-12T13:12:41+01:00", "Metadata": { "Name": "test", "Description": "this package is here for testing purposes only.", @@ -34,7 +34,7 @@ { "RepoPath": "src/PackageRegistryService/StagingArea/test/test@1.0.1.fsx", "FileName": "test@1.0.1.fsx", - "LastUpdated": "2024-02-12T13:12:45+01:00", + "LastUpdated": "2024-02-12T13:12:41+01:00", "Metadata": { "Name": "test", "Description": "this package is here for testing purposes only.", @@ -50,7 +50,7 @@ { "RepoPath": "src/PackageRegistryService/StagingArea/test/test@2.0.0.fsx", "FileName": "test@2.0.0.fsx", - "LastUpdated": "2024-02-12T13:12:45+01:00", + "LastUpdated": "2024-02-12T13:12:41+01:00", "Metadata": { "Name": "test", "Description": "this package is here for testing purposes only.",