Skip to content

Commit

Permalink
Merge pull request #14 from cybardev:deploy
Browse files Browse the repository at this point in the history
[feat] automate deployments to container registries
  • Loading branch information
cybardev authored Aug 26, 2024
2 parents a5bf7c0 + 958dbea commit 40d0920
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/dockerhub-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish Docker image

on:
push:
branches: main
paths: Dockerfile

# Allows running this workflow from GitHub Actions tab
workflow_dispatch:

jobs:
push_to_registry:
name: Push Docker image to Docker Hub and GitHub Packages
runs-on: ubuntu-latest
environment:
name: dockerhub
url: https://hub.docker.com/repositories/cybardev
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker [app img]
id: meta
uses: docker/metadata-action@v5
with:
images: |
cybardev/resumake
ghcr.io/cybardev/resumake
- name: Build and push Docker application image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: "cybardev/resumake:latest"
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ FROM ubuntu:22.04
ENV TZ=Etc/GMT
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN echo "Acquire::http::Pipeline-Depth 0;" > /etc/apt/apt.conf.d/99custom
RUN echo "Acquire::http::No-Cache true;" >> /etc/apt/apt.conf.d/99custom
RUN echo "Acquire::BrokenProxy true;" >> /etc/apt/apt.conf.d/99custom
RUN echo "Acquire::http::No-Cache true;" >> /etc/apt/apt.conf.d/99custom
RUN echo "Acquire::BrokenProxy true;" >> /etc/apt/apt.conf.d/99custom
WORKDIR /app

# install system dependencies
Expand Down

0 comments on commit 40d0920

Please sign in to comment.