Skip to content

Docker Image CI

Docker Image CI #143

Workflow file for this run

name: Docker Image CI
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
on:
schedule:
- cron: "37 0 * * 1"
push:
branches:
- main
- master
env:
DOCKER_BUILDKIT: 1
jobs:
build_unbound:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Create folder for images
run: |
sudo mkdir -p /images
sudo chmod 777 /images
- name: Build image
run: docker build -t horaynarea/unbound_docker:latest .
- name: Save image
run: docker save horaynarea/unbound_docker -o /images/unbound.tar.gz
- name: Cache image
uses: actions/cache@v3
with:
path: /images/unbound.tar.gz
key: ${{ github.run_id }}-${{ github.run_number }}-unbound
push_images:
needs: build_unbound
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Create folder for images
run: |
sudo mkdir -p /images
sudo chmod 777 /images
- name: Load unbound cache
uses: actions/cache@v3
with:
path: /images/unbound.tar.gz
key: ${{ github.run_id }}-${{ github.run_number }}-unbound
- name: Load docker images
run: |
docker load -i /images/unbound.tar.gz
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push images
run: docker push horaynarea/unbound_docker:latest