build_and_push_docker.yml 884 Bytes
Newer Older
1
name: build_and_push_docker.yml
Valerius's avatar
Valerius committed
2
3
4

on:
  push:
Valerius Mattfeld's avatar
Valerius Mattfeld committed
5
    branches: [ main ]
Valerius's avatar
Valerius committed
6
7
8
9
10
11
12

jobs:
  push_to_registry:
    name: Push Docker image to Container Registry
    runs-on: ubuntu-latest
    strategy:
      matrix:
Valerius Mattfeld's avatar
Valerius Mattfeld committed
13
        dockerfile: ['ACC', 'NOT_ACC']
Valerius's avatar
Valerius committed
14
15
16
17
18
    steps:
      - name: Check out the repo
        uses: actions/checkout@v2
      
      - name: Log in to Container Registry
19
        uses: docker/login-action@7f47463f5646678eb7ccf8f0f2e2d0896916a10a
Valerius's avatar
Valerius committed
20
21
22
23
24
25
        with:
          registry: "docker.gitlab.gwdg.de"
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}
      
      - name: Build and push Docker image
26
        uses: docker/build-push-action@4222161e3eb8351d8999164540f8c32116f921fa
Valerius's avatar
Valerius committed
27
28
29
        with:
          push: true
          file: ${{ matrix.dockerfile }}
Valerius Mattfeld's avatar
Valerius Mattfeld committed
30
          tags: docker.gitlab.gwdg.de/dfg/ui:${{ matrix.dockerfile }}-latest