aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/docker-image-release.yml
blob: d2e34feb4a90f4ea34e53e92628a1f96cb92053f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build and Push Docker Image

on:
  push:
    branches:
      - main

jobs:
  build:
    name: Build and Push Docker Image
    runs-on: ubuntu-latest

    steps:
      # Checkout the code from the repository
      - name: Checkout repository
        uses: actions/checkout@v3

      # # Download the latest release binary from GitHub releases
      # - name: Download latest release binary
      #   run: |
      #     latest_release=$(curl --silent "https://api.github.com/repos/donetick/donetick/releases/latest" | jq -r '.tag_name')
      #     curl -L "https://github.com/donetick/donetick/releases/download/${latest_release}/donetick_Linux_x86_64.tar.gz" -o donetick_Linux_x86_64.tar.gz
      #     tar -xzf donetick_Linux_x86_64.tar.gz
      #     chmod +x ./donetick


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

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


      # Build and tag Docker image
      - name: Build Docker image
        run: |
          docker build -t ${{ secrets.DOCKER_USERNAME }}/donetick:latest .

      # Push Docker image
      - name: Push Docker image
        run: |
          docker push ${{ secrets.DOCKER_USERNAME }}/donetick:latest