Skip to content

Commit

Permalink
ci: Create GitHub Actions for auto building images
Browse files Browse the repository at this point in the history
  • Loading branch information
itsamirhn committed May 24, 2024
1 parent d1e8396 commit 6cfcd9e
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: ci

permissions:
contents: read
packages: write

on:
push:
tags:
- "v*.*.*"

jobs:
build:
name: Build and Push Docker images
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/itsamirhn/dongetobede:latest
ghcr.io/itsamirhn/dongetobede:${{ github.ref_name }}

0 comments on commit 6cfcd9e

Please sign in to comment.