Skip to content

Commit

Permalink
Merge pull request #12 from agustinmista/master
Browse files Browse the repository at this point in the history
Add CI workflow to build and push Docker image
  • Loading branch information
Dennis Jekubczyk authored Feb 14, 2023
2 parents 542ce09 + c77cc93 commit 428417c
Show file tree
Hide file tree
Showing 3 changed files with 747 additions and 131 deletions.
8 changes: 8 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Node.js",
"image": "mcr.microsoft.com/devcontainers/javascript-node:0-18",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/dhoeric/features/act:1": {}
}
}
42 changes: 42 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Docker Image CI

env:
IMAGE_NAME: mirror-to-gitea

on:
push:
tags:
- '**'

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker-container
driver-opts: |
image=moby/buildkit:master
network=host
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:latest
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USER }}/${{ env.IMAGE_NAME }}:buildcache,mode=max
Loading

0 comments on commit 428417c

Please sign in to comment.