actions: add docker build (#317)

This commit is contained in:
FireMasterK 2021-01-22 20:31:10 +00:00 committed by GitHub
parent 67e15bb492
commit 1a3acd252c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 19 deletions

38
.github/workflows/build-docker.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Docker Multi-Architecture Build
on:
push:
paths-ignore:
- "**.md"
branches:
- master
jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
version: latest
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: zedeus/nitter:latest,zedeus/nitter:${{ github.sha }}

View File

@ -1,24 +1,5 @@
jobs:
include:
- stage: build
if: (NOT type IN (pull_request)) AND (branch = master)
language: minimal
services:
- docker
script:
- docker build -t $IMAGE_NAME:$TRAVIS_COMMIT .
- echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
- docker push $IMAGE_NAME:$TRAVIS_COMMIT
- stage: deploy
if: (NOT type IN (pull_request)) AND (branch = master)
language: minimal
services:
- docker
script:
- docker pull $IMAGE_NAME:$TRAVIS_COMMIT
- docker tag $IMAGE_NAME:$TRAVIS_COMMIT $IMAGE_NAME:latest
- echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
- docker push $IMAGE_NAME:latest
- stage: test
if: (NOT type IN (pull_request)) AND (branch = master)
dist: bionic