summaryrefslogtreecommitdiffstats
path: root/.github/workflows/somebook.yml
blob: b59293e07b6191652109c70d6cc551706cabe6ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: Build and Push

on:
  push:
    branches:
      - main

env:
  IMAGE: registry.digitalocean.com/jan-systems-registry/somebook:latest
  DO_DOCKER_LOGIN: ${{ secrets.DO_DOCKER_LOGIN }}

jobs:
  website:
    name: Build and Push
    runs-on: ubuntu-latest
    environment:
      name: production
      url: https://book.jan.systems

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      # Login to Digitalocean registry
      - name: Log in to Digitalocean registry
        run: docker login -u ${DO_DOCKER_LOGIN} -p ${DO_DOCKER_LOGIN} registry.digitalocean.com

      # Build the Docker image
      - name: Build image
        run: docker build -t ${IMAGE} .

      # Push the Docker image to Google Container Registry
      - name: Push image to registry
        run: docker push ${IMAGE}