29 lines (24 loc) · 1.09 KB
/
publish_docker.yml
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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Publish Docker image
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
push_to_registry:
name: Push Airflow Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Build docker image
run: docker build -t rocs-airflow:${{ github.ref_name }} . -f services/airflow/docker/airflow/Dockerfile
- name: Publish docker image to github packages
if: github.event_name == 'schedule' || github.event_name == 'push'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker tag rocs-airflow:${{ github.ref_name }} ghcr.io/${{ github.repository_owner }}/rocs-airflow:${{ github.ref_name }}
docker push ghcr.io/${{ github.repository_owner }}/rocs-airflow:${{ github.ref_name }}