Skip to content

Commit

Permalink
feat: docker build implemented by Github actions (#3)
Browse files Browse the repository at this point in the history
feat: docker build implemented by Github actions
  • Loading branch information
valeriocomo authored Oct 2, 2024
1 parent e988efa commit db002d7
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"esbenp.prettier-vscode",
"ms-azuretools.vscode-docker",
"github.vscode-pull-request-github",
"github.vscode-github-actions",
"Prisma.prisma"
],
"settings": {
Expand All @@ -33,6 +34,15 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
"[yaml]": {
"editor.autoIndent": "advanced"
},
"[dockercompose]": {
"editor.autoIndent": "advanced"
},
"[github-actions-workflow]": {
"editor.autoIndent": "advanced"
}
}
}
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: pull-request

on:
push:
branches: [main]
pull_request:
branches: [main]
# for future develpments
# tags:
# - v*

permissions:
# To push Docker images to GitHub
packages: write

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
file: "Dockerfile.app"
platforms: linux/amd64
push: false
tags: |
ghcr.io/teamdigitale/dataviz-srv:latest
ghcr.io/teamdigitale/dataviz-srv:0.0.1
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: release

on:
push:
branches: [main]
# for future develpments
# tags:
# - v*

permissions:
# To push Docker images to GitHub
packages: write

jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
file: "Dockerfile.app"
platforms: linux/amd64
push: true
tags: |
ghcr.io/teamdigitale/dataviz-srv:latest
ghcr.io/teamdigitale/dataviz-srv:0.0.1
File renamed without changes.

0 comments on commit db002d7

Please sign in to comment.