commit 71a5c260c16623f792842e2419848337f6c8f1d5 Author: Nicolas Trimborn Date: Tue Jul 18 19:07:12 2023 +0200 initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..05a8781 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM alpine +CMD ["echo", "Hello from the databaseme!"] \ No newline at end of file diff --git a/deploy-hello-world.yaml b/deploy-hello-world.yaml new file mode 100644 index 0000000..d7a4556 --- /dev/null +++ b/deploy-hello-world.yaml @@ -0,0 +1,46 @@ +name: Deploy Hello World + +on: + push: + branches: + - master + tags: + - "v*-hello-world" + pull_request: + branches: + - 'master' + +jobs: + deploy-docker-hello-world: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: git.nicktrimborn.de/hello-world + flavor: latest=true + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + + - name: Login to image repository + if: github.ref_type == 'tag' + uses: docker/login-action@v2 + with: + registry: git.nicktrimborn.de + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + file: docker/dockerfile/hello-world/Dockerfile + push: ${{ github.ref_type == 'tag' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file