diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index fb73d39..a424f0e 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -9,6 +9,14 @@ env: jobs: build-and-push-image: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - dockerfile: ./client/Dockerfile + image: ghcr.io/richmondramil/client + - dockerfile: ./server/Dockerfile + image: ghcr.io/richmondramil/server permissions: contents: read packages: write @@ -24,19 +32,20 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=sha + - name: Generate date-based tag + id: date-tag + run: echo "DATE_TAG=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . + file: ${{ matrix.dockerfile }} push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + tags: | + ${{ matrix.image }}:latest + ${{ matrix.image }}-${{ env.DATE_TAG }} + labels: | + org.opencontainers.image.source=${{ github.repositoryUrl }} + org.opencontainers.image.revision=${{ github.sha }} + org.opencontainers.image.created=${{ env.DATE_TAG }} diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 44279b7..0000000 --- a/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM alpine -CMD [ "echo", "Hello World" ] \ No newline at end of file diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..b4d1c10 --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine +CMD [ "echo", "Hello World Altus Client" ] \ No newline at end of file diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..5065dc9 --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine +CMD [ "echo", "Hello World Altus Server" ] \ No newline at end of file